From: Michael W. Hudson Date: Wed, 23 Jan 2002 15:07:46 +0000 (+0000) Subject: Fix for X-Git-Tag: v2.3c1~6797 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=af14289c5426743015dbbe0567e2c2677f1bff0c;p=thirdparty%2FPython%2Fcpython.git Fix for [ #433775 ] module build dir first in test import though not in the way the summary would suggest; use imp.load_dynamic() in setup.py to ensure we're testing the dynamic object we think we are. --- diff --git a/setup.py b/setup.py index ae08f4a6136f..6fc9360e97cb 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ __version__ = "$Revision$" -import sys, os, getopt +import sys, os, getopt, imp from distutils import sysconfig from distutils import text_file from distutils.errors import * @@ -168,8 +168,11 @@ class PyBuildExt(build_ext): 'WARNING: skipping import check for Carbon-based "%s"' % ext.name) return + ext_filename = os.path.join( + self.build_lib, + self.get_ext_filename(self.get_ext_fullname(ext.name))) try: - __import__(ext.name) + imp.load_dynamic(ext.name, ext_filename) except ImportError: self.announce('WARNING: removing "%s" since importing it failed' % ext.name)