call site 2 for code.Frame.repr
code/testing/test_excinfo.py - line 184
178
179
180
181
182
183
184
185
   def test_tbentry_reinterpret(): 
       try: 
           hello("hello") 
       except TypeError: 
           excinfo = py.code.ExceptionInfo() 
       tbentry = excinfo.traceback[-1]
->     msg = tbentry.reinterpret() 
       assert msg.startswith("TypeError: ('hello' + 5)") 
code/traceback2.py - line 43
37
38
39
40
41
42
43
44
45
46
47
   def reinterpret(self):
       """Reinterpret the failing statement and returns a detailed information
              about what operations are performed."""
       if self.exprinfo is None:
           from py.__.magic import exprinfo
           source = str(self.statement).strip()
->         x = exprinfo.interpret(source, self.frame, should_fail=True)
           if not isinstance(x, str):
               raise TypeError, "interpret returned non-string %r" % (x,)
           self.exprinfo = x 
       return self.exprinfo
magic/exprinfo.py - line 422
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
   def interpret(source, frame, should_fail=False):
       module = Interpretable(parse(source, 'exec').node)
       #print "got module", module
       if isinstance(frame, py.std.types.FrameType):
           frame = py.code.Frame(frame)
       try:
->         module.run(frame)
       except Failure, e:
           return getfailure(e)
       except passthroughex:
           raise
       except:
           import traceback
           traceback.print_exc()
       if should_fail:
           return "(inconsistently failed then succeeded)"
       else:
           return None
magic/exprinfo.py - line 382
379
380
381
382
   def run(self, frame):
       for stmt in self.nodes:
           stmt = Interpretable(stmt)
->         stmt.run(frame)
magic/exprinfo.py - line 372
370
371
372
373
374
   def run(self, frame):
       expr = Interpretable(self.expr)
->     expr.eval(frame)
       self.result = expr.result
       self.explanation = expr.explanation
magic/exprinfo.py - line 214
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
   def eval(self, frame, astpattern=astpattern,
                         co=compile(astpattern, '?', 'eval')):
       left = Interpretable(self.left)
       left.eval(frame)
       right = Interpretable(self.right)
->     right.eval(frame)
       self.explanation = (astpattern
                           .replace('__exprinfo_left',  left .explanation)
                           .replace('__exprinfo_right', right.explanation))
       try:
           self.result = frame.eval(co, __exprinfo_left=left.result,
                                        __exprinfo_right=right.result)
       except passthroughex:
           raise
       except:
           raise Failure(self)
magic/exprinfo.py - line 36
23
24
25
26
27
28
29
30
31
32
33
34
35
36
   def eval(self, frame):
       # fall-back for unknown expression nodes
       try:
           expr = ast.Expression(self.__obj__)
           expr.filename = '<eval>'
           self.__obj__.filename = '<eval>'
           co = pycodegen.ExpressionCodeGenerator(expr).getCode()
           result = frame.eval(co)
       except passthroughex:
           raise
       except:
           raise Failure(self)
       self.result = result
->     self.explanation = self.explanation or frame.repr(self.result)