]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix for a bug exposed by r45232:
authorArmin Rigo <arigo@tunes.org>
Mon, 17 Apr 2006 09:22:35 +0000 (09:22 +0000)
committerArmin Rigo <arigo@tunes.org>
Mon, 17 Apr 2006 09:22:35 +0000 (09:22 +0000)
    /path/to/uninstalled/python setup.py build_ext

now failed with pyconfig.h not found.  Prior to r45232
the above command did not look for pyconfig.h, but the
bug is really in the look-up code: expecting to find it
in os.curdir is a rather fragile idea.

Lib/distutils/sysconfig.py

index eafd49e7afb460d3bbf39c35673cdfc4ca98a86a..8d66cc2e7ee8f12005235a931f62e422968ba56b 100644 (file)
@@ -31,7 +31,7 @@ landmark = os.path.join(argv0_path, "Modules", "Setup")
 
 python_build = os.path.isfile(landmark)
 
-del argv0_path, landmark
+del landmark
 
 
 def get_python_version():
@@ -185,7 +185,7 @@ def customize_compiler(compiler):
 def get_config_h_filename():
     """Return full pathname of installed pyconfig.h file."""
     if python_build:
-        inc_dir = os.curdir
+        inc_dir = argv0_path
     else:
         inc_dir = get_python_inc(plat_specific=1)
     if get_python_version() < '2.2':