Update setup.py

This lets you locally install Pillow on Windows if you built it following the instructions of winbuild with pip install --editable ..\Pillow
This commit is contained in:
Meithal 2020-06-09 00:39:42 +02:00 committed by GitHub
parent ebd6901c95
commit 8c5f07f5ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -391,6 +391,10 @@ class pil_build_ext(build_ext):
_dbg("Looking for `%s` using pkg-config." % lib_name)
root = pkg_config(lib_name)
winbuil_root = os.path.join('.', 'winbuild', 'build')
if root is None and os.path.isdir(winbuil_root):
root = os.path.join(winbuil_root, 'lib'), os.path.join(winbuil_root, 'inc')
if isinstance(root, tuple):
lib_root, include_root = root
else: