Mercurial > cpython-lru_cache-weakref
diff setup.py @ 21788:05fabd8f4e7f legacy-trunk
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.
| author | Michael W. Hudson <mwh@python.net> |
|---|---|
| date | Wed, 23 Jan 2002 15:07:46 +0000 |
| parents | 3ef7bed007f6 |
| children | ab68ad43d514 |
line wrap: on
line diff
--- a/setup.py Wed Jan 23 15:04:41 2002 +0000 +++ b/setup.py Wed Jan 23 15:07:46 2002 +0000 @@ -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 @@ '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)
