From: Stefan Behnel Date: Fri, 27 Aug 2010 16:33:31 +0000 (+0200) Subject: another embed test fix for Python 2.4 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=61e85cecf694e9100804a1b7d91aad7825c0d389;p=cython.git another embed test fix for Python 2.4 --- 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: