[pypy-commit] pypy py3.5: fix

arigo pypy.commits at gmail.com
Tue Jan 3 13:51:05 EST 2017


Author: Armin Rigo <arigo at tunes.org>
Branch: py3.5
Changeset: r89347:c5679870cc23
Date: 2017-01-03 19:50 +0100
http://bitbucket.org/pypy/pypy/changeset/c5679870cc23/

Log:	fix

diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -1836,8 +1836,12 @@
         return fd
 
     def warn(self, w_msg, w_warningcls, stacklevel=2):
-        from pypy.module._warnings.interp_warnings import warn
-        warn(self, w_msg, w_warningcls, self.newint(stacklevel - 1))
+        from pypy.module._warnings.interp_warnings import do_warn
+
+        # 'w_warningcls' must a Warning subclass
+        if not we_are_translated():
+            assert self.issubtype_w(w_warningcls, self.w_Warning)
+        do_warn(self, w_msg, w_warningcls, stacklevel - 1)
 
 
 class AppExecCache(SpaceCache):


More information about the pypy-commit mailing list