call site 7 for path.local.pyimport
apigen/source/testing/test_browser.py - line 72
67
68
69
70
71
72
73
74
75
76
77
   def test_importing_goes_wrong():
       tmp = py.test.ensuretemp("sourcebrowserimport")
       tmp.ensure("x.py").write(py.code.Source("""
           import aslkdjaslkdjasdl
       """))
->     mod = parse_path(tmp.join("x.py"))
   
       tmp.ensure("y.py").write(py.code.Source("""
           raise KeyboardInterrupt 
       """))
       py.test.raises(KeyboardInterrupt, 'parse_path(tmp.join("y.py"))')
apigen/source/browser.py - line 133
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
   def parse_path(path):
       if not isinstance(path, PathBase):
           path = py.path.local(path)
       buf = path.open().read()
       st = parse(buf)
       # first go - we get all functions and classes defined on top-level
       nodes = dir_nodes(st)
       function_ast = [i for i in nodes if isinstance(i, ast.Function)]
       classes_ast = [i for i in nodes if isinstance(i, ast.Class)]
       mod_dict = dict([(i.name, function_from_ast(i, None)) for i in function_ast]
          + [(i.name, class_from_ast(i)) for i in classes_ast])
       # we check all the elements, if they're really there
       try:
->         mod = path.pyimport()
       except (KeyboardInterrupt, SystemExit):
           raise
       except:  # catch all other import problems generically
           # XXX some import problem: we probably should not
           # pretend to have an empty module 
           pass
       else:
           update_mod_dict(mod, mod_dict)
       return Module(path, mod_dict)