Replace distutils.sysconfig.get_config_var("prefix") with os.path.normpath(sys.prefix)

This commit is contained in:
Hugo van Kemenade 2020-07-21 11:23:38 +03:00
parent b243a6113e
commit 307239b234

View File

@ -14,7 +14,7 @@ import struct
import subprocess import subprocess
import sys import sys
import warnings import warnings
from distutils import ccompiler, sysconfig from distutils import ccompiler
from distutils.command.build_ext import build_ext from distutils.command.build_ext import build_ext
from setuptools import Extension, setup from setuptools import Extension, setup
@ -418,7 +418,7 @@ class pil_build_ext(build_ext):
for d in os.environ[k].split(os.path.pathsep): for d in os.environ[k].split(os.path.pathsep):
_add_directory(library_dirs, d) _add_directory(library_dirs, d)
prefix = sysconfig.get_config_var("prefix") prefix = os.path.normpath(sys.prefix)
if prefix: if prefix:
_add_directory(library_dirs, os.path.join(prefix, "lib")) _add_directory(library_dirs, os.path.join(prefix, "lib"))
_add_directory(include_dirs, os.path.join(prefix, "include")) _add_directory(include_dirs, os.path.join(prefix, "include"))