Skip to content

Commit 7daca67

Browse files
authored
Fix ImportError on Python 3.9.0b1 for Windows
1 parent db31563 commit 7daca67

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

setup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,11 @@ def build_extensions(self):
730730
if struct.unpack("h", b"\0\1")[0] == 1:
731731
defs.append(("WORDS_BIGENDIAN", None))
732732

733-
if sys.platform == "win32" and not (PLATFORM_PYPY or PLATFORM_MINGW):
733+
if (
734+
sys.platform == "win32" and
735+
sys.version_info < (3, 9) and
736+
not (PLATFORM_PYPY or PLATFORM_MINGW)
737+
):
734738
defs.append(("PILLOW_VERSION", '"\\"%s\\""' % PILLOW_VERSION))
735739
else:
736740
defs.append(("PILLOW_VERSION", '"%s"' % PILLOW_VERSION))

0 commit comments

Comments
 (0)