[pypy-commit] pypy py3k: w_None is a valid value to assign to __traceback__

antocuni noreply at buildbot.pypy.org
Wed Feb 15 16:00:27 CET 2012


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: py3k
Changeset: r52508:c1756f5aa63e
Date: 2012-02-15 16:00 +0100
http://bitbucket.org/pypy/pypy/changeset/c1756f5aa63e/

Log:	w_None is a valid value to assign to __traceback__

diff --git a/pypy/module/exceptions/interp_exceptions.py b/pypy/module/exceptions/interp_exceptions.py
--- a/pypy/module/exceptions/interp_exceptions.py
+++ b/pypy/module/exceptions/interp_exceptions.py
@@ -176,7 +176,9 @@
 
     def descr_settraceback(self, space, w_newtraceback):
         msg = '__traceback__ must be a traceback or None'
-        self.w_traceback = check_traceback(space, w_newtraceback, msg)
+        if not space.is_w(w_newtraceback, space.w_None):
+            w_newtraceback = check_traceback(space, w_newtraceback, msg)
+        self.w_traceback = w_newtraceback
 
     def descr_getitem(self, space, w_index):
         return space.getitem(space.newtuple(self.args_w), w_index)


More information about the pypy-commit mailing list