Commits

Amaury Forgeot d'Arc committed 0b3d3d4

Don't even try to load a dynamic module when cpyext is not enabled.
Also kill dead code.

Comments (0)

Files changed (2)

pypy/module/imp/app_imp.py

-
-
-def load_dynamic(name, pathname, file=None):
-    """Always raises ah ImportError on pypy"""
-    raise ImportError('Not implemented')

pypy/module/imp/interp_imp.py

 
 @unwrap_spec(filename=str)
 def load_dynamic(space, w_modulename, filename, w_file=None):
+    if not space.config.objspace.usemodules.cpyext:
+        raise OperationError(space.w_ImportError, space.wrap(
+            "Not implemented"))
     importing.load_c_extension(space, filename, space.str_w(w_modulename))
     return importing.check_sys_modules(space, w_modulename)