diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2014-01-04 22:09:28 (GMT) |
---|---|---|
committer | Eric Snow <ericsnowcurrently@gmail.com> | 2014-01-04 22:09:28 (GMT) |
commit | 335e14dd1adb302bc0e5b99534ccfca43c7a4d6c (patch) | |
tree | b1811cf83507b2581112ab8a53ab28a7fee62a68 /setup.py | |
parent | d749c7ae683a98bb2f0c1ac3c9ac2d3c5bb6e51f (diff) | |
download | cpython-335e14dd1adb302bc0e5b99534ccfca43c7a4d6c.zip cpython-335e14dd1adb302bc0e5b99534ccfca43c7a4d6c.tar.gz cpython-335e14dd1adb302bc0e5b99534ccfca43c7a4d6c.tar.bz2 |
Issue #19713: Move away from using find_module/load_module.
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -3,6 +3,8 @@ import sys, os, importlib.machinery, re, optparse from glob import glob +import importlib._bootstrap +import importlib.util import sysconfig from distutils import log @@ -327,8 +329,10 @@ class PyBuildExt(build_ext): return loader = importlib.machinery.ExtensionFileLoader(ext.name, ext_filename) + spec = importlib.util.spec_from_file_location(ext.name, ext_filename, + loader=loader) try: - loader.load_module() + importlib._bootstrap._SpecMethods(spec).load() except ImportError as why: self.failed.append(ext.name) self.announce('*** WARNING: renaming "%s" since importing it' |