[pypy-commit] pypy release-2.1.x: fix rpython-level exception

cfbolz noreply at buildbot.pypy.org
Tue Jul 16 09:29:40 CEST 2013


Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: release-2.1.x
Changeset: r65413:bff3c14f507a
Date: 2013-07-11 19:34 +0200
http://bitbucket.org/pypy/pypy/changeset/bff3c14f507a/

Log:	fix rpython-level exception

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
@@ -74,7 +74,7 @@
     return space.newtuple([w_fileobj, w_filename, w_import_info])
 
 def load_module(space, w_name, w_file, w_filename, w_info):
-    w_suffix, w_filemode, w_modtype = space.unpackiterable(w_info)
+    w_suffix, w_filemode, w_modtype = space.unpackiterable(w_info, 3)
 
     filename = space.str0_w(w_filename)
     filemode = space.str_w(w_filemode)
diff --git a/pypy/module/imp/test/test_import.py b/pypy/module/imp/test/test_import.py
--- a/pypy/module/imp/test/test_import.py
+++ b/pypy/module/imp/test/test_import.py
@@ -679,6 +679,10 @@
         assert module.__name__ == 'a'
         assert module.__file__ == 'invalid_path_name'
 
+    def test_crash_load_module(self):
+        import imp
+        raises(ValueError, imp.load_module, "", "", "", [1, 2, 3, 4])
+
 
 class TestAbi:
     def test_abi_tag(self):


More information about the pypy-commit mailing list