From 436eb08ca718185a19ed603074973f499e5e70f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tarek=20Ziad=C3=A9?= Date: Tue, 10 Feb 2009 12:33:42 +0000 Subject: Merged revisions 69485 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r69485 | tarek.ziade | 2009-02-10 13:31:09 +0100 (Tue, 10 Feb 2009) | 1 line Fixed #3386: the optional prefix argument was ignored under OS2 and NT in distutils.sysconfig.get_python_lib ........ --- Lib/distutils/sysconfig.py | 6 +++--- Lib/distutils/tests/test_sysconfig.py | 2 ++ Misc/NEWS | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py index 9993fba..615da07 100644 --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py @@ -129,7 +129,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: @@ -145,9 +145,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 aa1187e..9f82057 100644 --- a/Lib/distutils/tests/test_sysconfig.py +++ b/Lib/distutils/tests/test_sysconfig.py @@ -17,6 +17,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): # The check for srcdir is copied from Python's setup.py, diff --git a/Misc/NEWS b/Misc/NEWS index 23ea460..5ec0883 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -80,6 +80,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 #4890: Handle empty text search pattern in Tkinter.Text.search. - Issue #5170: Fixed Unicode output bug in logging and added test case. -- cgit v0.12