]> granicus.if.org Git - python/commitdiff
Fixed #3386: the optional prefix argument was ignored under OS2 and NT in distutils...
authorTarek Ziadé <ziade.tarek@gmail.com>
Tue, 10 Feb 2009 12:31:09 +0000 (12:31 +0000)
committerTarek Ziadé <ziade.tarek@gmail.com>
Tue, 10 Feb 2009 12:31:09 +0000 (12:31 +0000)
Lib/distutils/sysconfig.py
Lib/distutils/tests/test_sysconfig.py
Misc/NEWS

index 4e06546acd6bd4a253adfef17c9afa6a6c84c6ae..56cb861a6cbcca72683dceeaa0186eab9e1f4d45 100644 (file)
@@ -132,7 +132,7 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
             if get_python_version() < "2.2":
                 return prefix
             else:
-                return os.path.join(PREFIX, "Lib", "site-packages")
+                return os.path.join(prefix, "Lib", "site-packages")
 
     elif os.name == "mac":
         if plat_specific:
@@ -148,9 +148,9 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
 
     elif os.name == "os2":
         if standard_lib:
-            return os.path.join(PREFIX, "Lib")
+            return os.path.join(prefix, "Lib")
         else:
-            return os.path.join(PREFIX, "Lib", "site-packages")
+            return os.path.join(prefix, "Lib", "site-packages")
 
     else:
         raise DistutilsPlatformError(
index 4636c0c127d7c4588617f4e834f7357bfbdc3e36..dd17eb347fe452b2a154d10f3c6660e9f69ba21d 100644 (file)
@@ -26,6 +26,8 @@ class SysconfigTestCase(unittest.TestCase):
         # 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?
+        self.assertNotEqual(sysconfig.get_python_lib(),
+                            sysconfig.get_python_lib(prefix=TESTFN))
 
     def test_get_python_inc(self):
         inc_dir = sysconfig.get_python_inc()
index cc71e83510b7665abd28e397411fb230c9806821..8eb6862b66a02828d620a42e7c565db2eac5f8f0 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -152,6 +152,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #3386: distutils.sysconfig.get_python_lib prefix argument was ignored
+  under NT and OS2. Patch by Philip Jenvey.
+
 - Issue #5128: Make compileall properly inspect bytecode to determine if needs
   to be recreated. This avoids a timing hole thanks to the old reliance on the
   ctime of the files involved.