Mercurial > cpython-lru_cache-weakref
diff setup.py @ 84157:4a1161eaed99
Issue # 17177: Stop using imp in setup.py
| author | Brett Cannon <brett@python.org> |
|---|---|
| date | Sat, 15 Jun 2013 17:52:59 -0400 |
| parents | 02a89bd646ca |
| children | e13ff9fdfaf9 |
line wrap: on
line diff
--- a/setup.py Sat Jun 15 17:33:27 2013 -0400 +++ b/setup.py Sat Jun 15 17:52:59 2013 -0400 @@ -1,7 +1,7 @@ # Autodetecting setup.py script for building the Python extensions # -import sys, os, imp, re, optparse +import sys, os, importlib.machinery, re, optparse from glob import glob import sysconfig @@ -325,8 +325,9 @@ if cross_compiling: return + loader = importlib.machinery.ExtensionFileLoader(ext.name, ext_filename) try: - imp.load_dynamic(ext.name, ext_filename) + loader.load_module() except ImportError as why: self.failed.append(ext.name) self.announce('*** WARNING: renaming "%s" since importing it'
