Author: Armin Rigo <[email protected]>
Branch: py3.5
Changeset: r89344:4be96d48f937
Date: 2017-01-03 18:49 +0100
http://bitbucket.org/pypy/pypy/changeset/4be96d48f937/

Log:    Use a simpler, direct method of implementing space.warn()

diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -1836,11 +1836,8 @@
         return fd
 
     def warn(self, w_msg, w_warningcls, stacklevel=2):
-        self.appexec([w_msg, w_warningcls, self.wrap(stacklevel)],
-                     """(msg, warningcls, stacklevel):
-            import _warnings
-            _warnings.warn(msg, warningcls, stacklevel=stacklevel)
-        """)
+        from pypy.module._warnings.interp_warnings import warn
+        warn(self, w_msg, w_warningcls, self.newint(stacklevel - 1))
 
 
 class AppExecCache(SpaceCache):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to