[pypy-svn] pypy imp.load_dyanmic: (mfoord) default implementation of imp.load_dynamic that raises an ImportError

mfoord commits-noreply at bitbucket.org
Sat Jan 22 12:30:20 CET 2011


Author: Michael Foord <michael at voidspace.org.uk>
Branch: imp.load_dyanmic
Changeset: r41208:44001dbc8d3e
Date: 2011-01-22 12:28 +0100
http://bitbucket.org/pypy/pypy/changeset/44001dbc8d3e/

Log:	(mfoord) default implementation of imp.load_dynamic that raises an
	ImportError

diff --git a/pypy/module/imp/test/test_app.py b/pypy/module/imp/test/test_app.py
--- a/pypy/module/imp/test/test_app.py
+++ b/pypy/module/imp/test/test_app.py
@@ -32,6 +32,9 @@
         assert pathname.endswith('.py') # even if .pyc is up-to-date
         assert description in self.imp.get_suffixes()
 
+    def test_load_dynamic(self):
+        raises(ImportError, self.imp.load_dynamic, 'foo', 'bar')
+        raises(ImportError, self.imp.load_dynamic, 'foo', 'bar', 'baz.so')
 
     def test_suffixes(self):
         for suffix, mode, type in self.imp.get_suffixes():

diff --git a/pypy/module/imp/__init__.py b/pypy/module/imp/__init__.py
--- a/pypy/module/imp/__init__.py
+++ b/pypy/module/imp/__init__.py
@@ -34,6 +34,7 @@
         }
 
     appleveldefs = {
+        'load_dynamic':    'app_imp.load_dynamic',
         }
 
     def __init__(self, space, *args):


More information about the Pypy-commit mailing list