call site 6 for code.Source.__getslice__
code/testing/test_excinfo.py - line 68
66
67
68
69
70
   def test_traceback_entry_getsource(self):
       tb = self.excinfo.traceback 
->     s = str(tb[-1].getsource() )
       assert s.startswith("def f():")
       assert s.endswith("raise ValueError") 
code/traceback2.py - line 69
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
   def getsource(self): 
       """ return failing source code. """ 
       source = self.frame.code.fullsource
       start = self.getfirstlinesource()
       end = self.lineno
       try:
           _, end = source.getstatementrange(end) 
       except IndexError: 
           end = self.lineno + 1 
       # heuristic to stop displaying source on e.g. 
       #   if something:  # assume this causes a NameError
       #      # _this_ lines and the one 
              #        below we don't want from entry.getsource() 
       for i in range(self.lineno, end): 
           if source[i].rstrip().endswith(':'): 
               end = i + 1
               break 
->     return source[start:end]