expose py.code._reinterpret functions so that pypy and internal

uses don't need to go through internal implementation imports

--HG--
branch : trunk
This commit is contained in:
holger krekel
2010-04-29 01:20:56 +02:00
parent 78d67c007b
commit 030548bc73
5 changed files with 16 additions and 14 deletions

View File

@@ -199,9 +199,8 @@ class TracebackEntry(object):
"""Reinterpret the failing statement and returns a detailed information
about what operations are performed."""
if self.exprinfo is None:
from py._code import assertion
source = str(self.statement).strip()
x = assertion.interpret(source, self.frame, should_fail=True)
x = py.code._reinterpret(source, self.frame, should_fail=True)
if not isinstance(x, str):
raise TypeError("interpret returned non-string %r" % (x,))
self.exprinfo = x