summaryrefslogtreecommitdiffstats
path: root/Lib/distutils
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-02-10 12:31:09 (GMT)
committerTarek Ziadé <ziade.tarek@gmail.com>2009-02-10 12:31:09 (GMT)
commit74fbf60e8c3d516fd193c40235c0a2eaaeae8918 (patch)
tree00b3d716b0f8092182adee097e93bcd6771366bf /Lib/distutils
parent28d108893c5a6663c1747b1c79d0432ba7794e63 (diff)
downloadcpython-74fbf60e8c3d516fd193c40235c0a2eaaeae8918.zip
cpython-74fbf60e8c3d516fd193c40235c0a2eaaeae8918.tar.gz
cpython-74fbf60e8c3d516fd193c40235c0a2eaaeae8918.tar.bz2
Fixed #3386: the optional prefix argument was ignored under OS2 and NT in distutils.sysconfig.get_python_lib
Diffstat (limited to 'Lib/distutils')
-rw-r--r--Lib/distutils/sysconfig.py6
-rw-r--r--Lib/distutils/tests/test_sysconfig.py2
2 files changed, 5 insertions, 3 deletions
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
index 4e06546..56cb861 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -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(
diff --git a/Lib/distutils/tests/test_sysconfig.py b/Lib/distutils/tests/test_sysconfig.py
index 4636c0c..dd17eb3 100644
--- a/Lib/distutils/tests/test_sysconfig.py
+++ b/Lib/distutils/tests/test_sysconfig.py
@@ -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()