call site 0 for code.Source.getblockend
code/testing/test_source.py - line 253
244
245
246
247
248
249
250
251
252
253
254
   def test_getfuncsource_dynamic():
       source = """
           def f():
               raise ValueError
   
           def g(): pass
       """
       co = py.code.compile(source)
       exec co
->     assert str(py.code.Source(f)).strip() == 'def f():\n    raise ValueError'
       assert str(py.code.Source(g)).strip() == 'def g(): pass'
code/source.py - line 30
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
   def __init__(self, *parts, **kwargs):
       self.lines = lines = []
       de = kwargs.get('deindent', True)
       rstrip = kwargs.get('rstrip', True) 
       for part in parts:
           if not part: 
               partlines = []
           if isinstance(part, Source):
               partlines = part.lines
           elif isinstance(part, (unicode, str)):
               partlines = part.split('\n')
               if rstrip:
                   while partlines: 
                       if partlines[-1].strip(): 
                           break
                       partlines.pop()
           else:
->             partlines = getsource(part, deindent=de).lines
           if de:
               partlines = deindent(partlines)
           lines.extend(partlines)
code/source.py - line 239
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
   def getsource(obj, **kwargs):
       if hasattr(obj, 'func_code'):
           obj = obj.func_code
       elif hasattr(obj, 'f_code'):
           obj = obj.f_code
       try:
           fullsource = obj.co_filename.__source__
       except AttributeError:
           try:
               strsrc = inspect.getsource(obj)
           except IndentationError:
               strsrc = "\"Buggy python version consider upgrading, cannot get source\""
           assert isinstance(strsrc, str)
           return Source(strsrc, **kwargs)
       else:
           lineno = obj.co_firstlineno - 1
->         end = fullsource.getblockend(lineno)
           return fullsource[lineno:end+1]