summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index e6f3b53..798220b 100644
--- a/setup.py
+++ b/setup.py
@@ -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 @@ class PyBuildExt(build_ext):
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'