diff --git a/Tests/test_image_access.py b/Tests/test_image_access.py index 25cc9fef4..9a3af9e53 100644 --- a/Tests/test_image_access.py +++ b/Tests/test_image_access.py @@ -2,7 +2,8 @@ import ctypes import os import subprocess import sys -from distutils import ccompiler, sysconfig +import sysconfig +from distutils import ccompiler import pytest from PIL import Image @@ -360,12 +361,11 @@ int main(int argc, char* argv[]) ) compiler = ccompiler.new_compiler() - compiler.add_include_dir(sysconfig.get_python_inc()) + compiler.add_include_dir(sysconfig.get_config_var("INCLUDEPY")) - libdir = sysconfig.get_config_var( - "LIBDIR" - ) or sysconfig.get_python_inc().replace("include", "libs") - print(libdir) + libdir = sysconfig.get_config_var("LIBDIR") or sysconfig.get_config_var( + "INCLUDEPY" + ).replace("include", "libs") compiler.add_library_dir(libdir) objects = compiler.compile(["embed_pil.c"]) compiler.link_executable(objects, "embed_pil")