diff --git a/setup.py b/setup.py index 6cab2e715c3..afb0e3b5373 100755 --- a/setup.py +++ b/setup.py @@ -15,8 +15,9 @@ import sys import warnings +from setuptools import Extension from setuptools import __version__ as setuptools_version -from setuptools import Extension, setup +from setuptools import setup from setuptools.command.build_ext import build_ext @@ -854,6 +855,7 @@ def build_extensions(self): and not (PLATFORM_PYPY or PLATFORM_MINGW) ): from packaging.version import parse as parse_version + if parse_version(setuptools_version) < parse_version("60.0.0"): defs[-1] = ("PILLOW_VERSION", f'"\\"{PILLOW_VERSION}\\""')