Navigation Menu

Skip to content

Commit

Permalink
Strip out wrong info from tracebacks on CPython 2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
dag committed Feb 12, 2011
1 parent 07560e7 commit b7ccbec
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion attest/reporters.py
Expand Up @@ -13,7 +13,8 @@
abstractmethod = lambda x: x

from . import statistics
from .hook import ExpressionEvaluator, TestFailure
from .hook import (ExpressionEvaluator, TestFailure, COMPILES_AST,
AssertImportHook)


class TestResult(object):
Expand Down Expand Up @@ -60,6 +61,11 @@ def raw_traceback(self):
"""
tb = traceback.extract_tb(self.exc_info[2])
if not COMPILES_AST and AssertImportHook.enabled:
newtb = []
for filename, lineno, funcname, text in tb:
newtb.append((filename, 0, funcname, None))
tb = newtb
clean = []
thisfile = path.abspath(path.dirname(__file__))
for item in tb:
Expand Down

0 comments on commit b7ccbec

Please sign in to comment.