allow file to be compiled on 2.5

--HG--
branch : trunk
This commit is contained in:
Benjamin Peterson 2009-08-29 11:36:08 -05:00
parent 78d0d4656b
commit 6f4c6d36a4
1 changed files with 3 additions and 2 deletions

View File

@ -23,7 +23,8 @@ def interpret(source, frame, should_fail=False):
visitor = DebugInterpreter(frame) visitor = DebugInterpreter(frame)
try: try:
visitor.visit(mod) visitor.visit(mod)
except Failure as failure: except Failure:
failure = sys.exc_info()[1]
return getfailure(failure) return getfailure(failure)
if should_fail: if should_fail:
return ("(assertion failed, but when it was re-run for " return ("(assertion failed, but when it was re-run for "
@ -127,7 +128,7 @@ class DebugInterpreter(ast.NodeVisitor):
co = self._compile(source) co = self._compile(source)
try: try:
local = self.frame.eval(co) local = self.frame.eval(co)
except Exception as e: except Exception:
# have to assume it isn't # have to assume it isn't
local = False local = False
if not local: if not local: