Author: Matti Picus <[email protected]>
Branch: py3.6
Changeset: r97163:a24307b274dc
Date: 2019-08-12 19:09 +0300
http://bitbucket.org/pypy/pypy/changeset/a24307b274dc/

Log:    the exception types have changed for import errors

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
@@ -461,14 +461,14 @@
                     print('__name__ =', __name__)
                     from .struct import inpackage
         """, ns)
-        raises(SystemError, ns['imp'])
+        raises(ImportError, ns['imp'])
 
     def test_future_relative_import_error_when_in_non_package2(self):
         ns = {'__name__': __name__}
         exec("""def imp():
                     from .. import inpackage
         """, ns)
-        raises(SystemError, ns['imp'])
+        raises(ImportError, ns['imp'])
 
     def test_relative_import_with___name__(self):
         import sys
@@ -517,12 +517,12 @@
         # Check relative fails with only __package__ wrong
         ns = dict(__package__='foo', __name__='pkg.notarealmodule')
         check_absolute() # XXX check warnings
-        raises(SystemError, check_relative)
+        raises(ModuleNotFoundError, check_relative)
 
         # Check relative fails with __package__ and __name__ wrong
         ns = dict(__package__='foo', __name__='notarealpkg.notarealmodule')
         check_absolute() # XXX check warnings
-        raises(SystemError, check_relative)
+        raises(ModuleNotFoundError, check_relative)
 
         # Check relative fails when __package__ set to a non-string
         ns = dict(__package__=object())
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to