call site 1 for path.svnwc.new
path/testing/fscommon.py - line 245
243
244
245
246
   def test__getpymodule_d(self):
       otherdir = self.root.join('otherdir')
->     mod = otherdir.join('d.py')._getpymodule()
       assert mod.value2 == "got it"
path/common.py - line 387
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
   def _getpymodule(self):
       """resolve this path to a module python object. """
       modname = str(self)
       modname = modname.replace('.', self.sep)
       try:
           return sys.modules[modname]
       except KeyError:
           co = self._getpycodeobj()
           mod = py.std.new.module(modname)
           mod.__file__ = PathStr(self)
           if self.basename == '__init__.py':
               mod.__path__ = [str(self.dirpath())]
           sys.modules[modname] = mod
           try: 
->             exec co in mod.__dict__
           except: 
               del sys.modules[modname] 
               raise 
           return mod
None</build/buildd/codespeak-lib-0.9.0/py/code/source.py:213> - line 1
1
-> import py; py.magic.autopath()
path/common.py - line 444
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
   def custom_import_hook(name, glob=None, loc=None, fromlist=None):
       __tracebackhide__ = False 
       __file__ = glob and glob.get('__file__')
       if isinstance(__file__, PathStr):
           # try to perform a relative import
           # for cooperation with py.magic.autopath, first look in the pkgdir
           modules = None
           if hasattr(__file__.__path__, 'pkgdir'):
               modules = relativeimport(__file__.__path__.pkgdir, name)
           if not modules:
->             modules = relativeimport(__file__.__path__, name)
           if modules:
               if fromlist:
                   submodule = modules[-1]  # innermost submodule
                   # try to import submodules named in the 'fromlist' if the
                   # 'submodule' is a package
                   p = submodule.__file__.__path__
                   if p.check(basename='__init__.py'):
                       for name in fromlist:
                           relativeimport(p, name, parent=submodule)
                           # failures are fine
                   return submodule
               else:
                   return modules[0]   # outermost package
       # fall-back
       __tracebackhide__ = True 
       return old_import_hook(name, glob, loc, fromlist)
path/common.py - line 418
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
   def relativeimport(p, name, parent=None):
       names = name.split('.')
       last_list = [False] * (len(names)-1) + [True]
       modules = []
       for name, is_last in zip(names, last_list):
           if hasattr(parent, name):
               # shortcut if there is already the correct name
               # in the parent package
               submodule = getattr(parent, name)
           else:
->             if is_last and p.new(basename=name+'.py').check():
                   p = p.new(basename=name+'.py')
               else:
                   p = p.new(basename=name).join('__init__.py')
                   if not p.check():
                       return None   # not found
               submodule = p._getpymodule()
               if parent is not None:
                   setattr(parent, name, submodule)
           modules.append(submodule)
           parent = submodule
       return modules   # success