From 7daca6733d99c68fcbe0ca81a5fca559b3e112da Mon Sep 17 00:00:00 2001 From: Christoph Gohlke Date: Tue, 19 May 2020 15:35:32 -0700 Subject: [PATCH 1/2] Fix ImportError on Python 3.9.0b1 for Windows --- setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1236b5df5..97ff3f2b6 100755 --- a/setup.py +++ b/setup.py @@ -730,7 +730,11 @@ class pil_build_ext(build_ext): if struct.unpack("h", b"\0\1")[0] == 1: defs.append(("WORDS_BIGENDIAN", None)) - if sys.platform == "win32" and not (PLATFORM_PYPY or PLATFORM_MINGW): + if ( + sys.platform == "win32" and + sys.version_info < (3, 9) and + not (PLATFORM_PYPY or PLATFORM_MINGW) + ): defs.append(("PILLOW_VERSION", '"\\"%s\\""' % PILLOW_VERSION)) else: defs.append(("PILLOW_VERSION", '"%s"' % PILLOW_VERSION)) From ac7848c78157b0e70a4944d56a3b2c5ad6fd8f19 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 20 May 2020 20:31:14 +1000 Subject: [PATCH 2/2] Lint fix --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 97ff3f2b6..8c9f0213f 100755 --- a/setup.py +++ b/setup.py @@ -731,9 +731,9 @@ class pil_build_ext(build_ext): defs.append(("WORDS_BIGENDIAN", None)) if ( - sys.platform == "win32" and - sys.version_info < (3, 9) and - not (PLATFORM_PYPY or PLATFORM_MINGW) + sys.platform == "win32" + and sys.version_info < (3, 9) + and not (PLATFORM_PYPY or PLATFORM_MINGW) ): defs.append(("PILLOW_VERSION", '"\\"%s\\""' % PILLOW_VERSION)) else: