mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-04-29 13:33:43 +03:00
If an exception is raised, try again without system paths
This commit is contained in:
parent
9ea4624704
commit
6ec9dfb9c0
48
setup.py
48
setup.py
|
@ -250,28 +250,32 @@ def _cmd_exists(cmd):
|
||||||
|
|
||||||
|
|
||||||
def _pkg_config(name):
|
def _pkg_config(name):
|
||||||
try:
|
command = os.environ.get("PKG_CONFIG", "pkg-config")
|
||||||
command = os.environ.get("PKG_CONFIG", "pkg-config")
|
for keep_system in (True, False):
|
||||||
command_libs = [command, "--libs-only-L", "--keep-system-libs", name]
|
try:
|
||||||
command_cflags = [command, "--cflags-only-I", "--keep-system-cflags", name]
|
command_libs = [command, "--libs-only-L", name]
|
||||||
if not DEBUG:
|
command_cflags = [command, "--cflags-only-I", name]
|
||||||
command_libs.append("--silence-errors")
|
if keep_system:
|
||||||
command_cflags.append("--silence-errors")
|
command_libs.append("--keep-system-libs")
|
||||||
libs = (
|
command_cflags.append("--keep-system-cflags")
|
||||||
subprocess.check_output(command_libs)
|
if not DEBUG:
|
||||||
.decode("utf8")
|
command_libs.append("--silence-errors")
|
||||||
.strip()
|
command_cflags.append("--silence-errors")
|
||||||
.replace("-L", "")
|
libs = (
|
||||||
)
|
subprocess.check_output(command_libs)
|
||||||
cflags = (
|
.decode("utf8")
|
||||||
subprocess.check_output(command_cflags)
|
.strip()
|
||||||
.decode("utf8")
|
.replace("-L", "")
|
||||||
.strip()
|
)
|
||||||
.replace("-I", "")
|
cflags = (
|
||||||
)
|
subprocess.check_output(command_cflags)
|
||||||
return libs, cflags
|
.decode("utf8")
|
||||||
except Exception:
|
.strip()
|
||||||
pass
|
.replace("-I", "")
|
||||||
|
)
|
||||||
|
return libs, cflags
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class pil_build_ext(build_ext):
|
class pil_build_ext(build_ext):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user