]> granicus.if.org Git - python/commitdiff
Fixed bug #1628
authorChristian Heimes <christian@cheimes.de>
Fri, 14 Dec 2007 23:42:36 +0000 (23:42 +0000)
committerChristian Heimes <christian@cheimes.de>
Fri, 14 Dec 2007 23:42:36 +0000 (23:42 +0000)
The detection now works on Unix with Makefile, Makefile with VPATH and on Windows.

Lib/distutils/sysconfig.py
Lib/distutils/tests/test_sysconfig.py

index aead1a19ba6d4720698c08c3bef1d916ba9e6c58..32b165ffd119d9ef0dda0faadf42a3dedb1e5dee 100644 (file)
@@ -31,8 +31,10 @@ if os.name == "nt" and "pcbuild" in project_base[-8:].lower():
 # python_build: (Boolean) if true, we're either building Python or
 # building an extension with an un-installed Python, so we use
 # different (hard-wired) directories.
-python_build = os.path.isfile(os.path.join(project_base, "Modules",
-                                           "Setup.local"))
+# Setup.local is available for Makefile builds including VPATH builds,
+# Setup.dist is available on Windows
+python_build = any(os.path.isfile(os.path.join(project_base, "Modules", fn))
+                   for fn in ("Setup.dist", "Setup.local"))
 
 
 def get_python_version():
index ef7c38bf7870dcaa1f2c8c603d8bf83f1361d106..770b7c376fdfdfb17610fb05a3fb11dc8064b7e4 100644 (file)
@@ -15,7 +15,7 @@ class SysconfigTestCase(unittest.TestCase):
 
     def test_get_python_lib(self):
         lib_dir = sysconfig.get_python_lib()
-        # XXX doesn't work on Inux when Python was never installed before
+        # XXX doesn't work on Linux when Python was never installed before
         #self.assert_(os.path.isdir(lib_dir), lib_dir)
         # test for pythonxx.lib?