From 61e85cecf694e9100804a1b7d91aad7825c0d389 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 27 Aug 2010 18:33:31 +0200 Subject: [PATCH] another embed test fix for Python 2.4 --- runtests.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/runtests.py b/runtests.py index bc407ca1..d4d7d323 100644 --- a/runtests.py +++ b/runtests.py @@ -646,9 +646,15 @@ class EmbedTest(unittest.TestCase): def test_embed(self): from distutils import sysconfig + libname = sysconfig.get_config_var('LIBRARY') libdir = sysconfig.get_config_var('LIBDIR') - if not os.path.isdir(libdir): - libdir = os.path.join(os.path.dirname(sys.executable), '../lib') + if not os.path.isdir(libdir) or libname not in os.listdir(libdir): + libdir = os.path.join(os.path.dirname(sys.executable), '..', 'lib') + if not os.path.isdir(libdir) or libname not in os.listdir(libdir): + libdir = os.path.join(libdir, 'python%d.%d' % sys.version_info[:2], 'config') + if not os.path.isdir(libdir) or libname not in os.listdir(libdir): + # report the error for the original directory + libdir = sysconfig.get_config_var('LIBDIR') self.assert_(os.system( "make PYTHON='%s' LIBDIR1='%s' test > make.output" % (sys.executable, libdir)) == 0) try: -- 2.26.2