Skip to content

Recent Update breaks old Python code #13

Description

@XhrisPhillips

The recent push request by me has broken things on older versions of Python:

Debian GNU/Linux 11 (bullseye)
Python 3.9.2
Pillow                   8.1.2

This version of the Pillow does not know the Resampling Method:

Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python3.9/tkinter/__init__.py", line 1892, in __call__
    return self.func(*args)
  File "/home/vlbi/friendlyVRI/Imports/util_tk.py", line 1069, in _load_preview
    imgPIL.thumbnail(self.thumbSize, Image.Resampling.LANCZOS)
  File "/usr/lib/python3/dist-packages/PIL/Image.py", line 62, in __getattr__
    raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
AttributeError: module 'PIL.Image' has no attribute 'Resampling'

Maybe the 2 relevant lines need check the version?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions