[pypy-svn] pypy default: Don't even try to load a dynamic module when cpyext is not enabled.

amauryfa commits-noreply at bitbucket.org
Fri Mar 25 22:31:32 CET 2011


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: 
Changeset: r42947:0b3d3d480f7e
Date: 2011-03-25 22:31 +0100
http://bitbucket.org/pypy/pypy/changeset/0b3d3d480f7e/

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

diff --git a/pypy/module/imp/app_imp.py b/pypy/module/imp/app_imp.py
deleted file mode 100644
--- a/pypy/module/imp/app_imp.py
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-def load_dynamic(name, pathname, file=None):
-    """Always raises ah ImportError on pypy"""
-    raise ImportError('Not implemented')

diff --git a/pypy/module/imp/interp_imp.py b/pypy/module/imp/interp_imp.py
--- a/pypy/module/imp/interp_imp.py
+++ b/pypy/module/imp/interp_imp.py
@@ -128,6 +128,9 @@
 
 @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)
 


More information about the Pypy-commit mailing list