diff --git a/flask_admin/form/upload.py b/flask_admin/form/upload.py index deb0e06ed..b900027a6 100644 --- a/flask_admin/form/upload.py +++ b/flask_admin/form/upload.py @@ -21,20 +21,6 @@ try: from PIL import Image, ImageOps - - # to support pillow < 9.1.0 - if not hasattr(Image, 'Resampling'): - from enum import IntEnum - - class Resampling(IntEnum): - NEAREST = 0 - BOX = 4 - BILINEAR = 2 - HAMMING = 5 - BICUBIC = 3 - LANCZOS = 1 - - Image.Resampling = Resampling except ImportError: Image = None ImageOps = None diff --git a/setup.py b/setup.py index a54df28cc..88a07eafe 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,6 @@ # Fix for older setuptools import re import os -import sys from setuptools import setup, find_packages @@ -21,6 +20,7 @@ def desc(): except IOError: return info + # grep flask_admin/__init__.py since python 3.x cannot import it before using 2to3 file_text = read(fpath('flask_admin/__init__.py')) @@ -61,7 +61,7 @@ def grep(attrname): install_requires=install_requires, tests_require=[ 'pytest', - 'pillow>=3.3.2', + 'pillow>=9.1.0', 'mongoengine', 'pymongo', 'wtf-peewee',