From 6f4c6d36a4c9cceae1a9cf378e1641b2128e38ca Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sat, 29 Aug 2009 11:36:08 -0500 Subject: [PATCH] allow file to be compiled on 2.5 --HG-- branch : trunk --- py/code/_assertionnew.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/py/code/_assertionnew.py b/py/code/_assertionnew.py index 73430e9ae..0fc0046ea 100644 --- a/py/code/_assertionnew.py +++ b/py/code/_assertionnew.py @@ -23,7 +23,8 @@ def interpret(source, frame, should_fail=False): visitor = DebugInterpreter(frame) try: visitor.visit(mod) - except Failure as failure: + except Failure: + failure = sys.exc_info()[1] return getfailure(failure) if should_fail: return ("(assertion failed, but when it was re-run for " @@ -127,7 +128,7 @@ class DebugInterpreter(ast.NodeVisitor): co = self._compile(source) try: local = self.frame.eval(co) - except Exception as e: + except Exception: # have to assume it isn't local = False if not local: