From 0f5ed3abc788a3d1ec221cd637a6493510e7c42e Mon Sep 17 00:00:00 2001 From: holger krekel Date: Tue, 11 May 2010 17:43:56 +0200 Subject: [PATCH] avoid helper functions showing up in py.test tracebacks --HG-- branch : trunk --- CHANGELOG | 6 ++++++ py/_builtin.py | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 6205cab6d..7d59becae 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +Changes between 1.3.0 and 1.3.1 +================================================== + +- improve tracebacks showing: + - raises shows shorter more relevant tracebacks + Changes between 1.2.1 and 1.3.0 ================================================== diff --git a/py/_builtin.py b/py/_builtin.py index d5c96285d..4df3daae4 100644 --- a/py/_builtin.py +++ b/py/_builtin.py @@ -175,6 +175,7 @@ else: def exec_(obj, globals=None, locals=None): """ minimal backport of py3k exec statement. """ + __tracebackhide__ = True if globals is None: frame = sys._getframe(1) globals = frame.f_globals @@ -187,14 +188,17 @@ else: if sys.version_info >= (3,0): exec (""" def _reraise(cls, val, tb): + __tracebackhide__ = True assert hasattr(val, '__traceback__') raise val """) else: exec (""" def _reraise(cls, val, tb): + __tracebackhide__ = True raise cls, val, tb def exec2(obj, globals, locals): + __tracebackhide__ = True exec obj in globals, locals """)