@ -683,12 +683,6 @@ class Importer(object):
_tls . running = True
_tls . running = True
try :
try :
_v and LOG . debug ( ' %r .find_module( %r ) ' , self , fullname )
_v and LOG . debug ( ' %r .find_module( %r ) ' , self , fullname )
# #114: explicitly whitelisted prefixes override any
# system-installed package.
if self . whitelist != [ ' ' ] :
if any ( fullname . startswith ( s ) for s in self . whitelist ) :
return self
pkgname , dot , _ = fullname . rpartition ( ' . ' )
pkgname , dot , _ = fullname . rpartition ( ' . ' )
pkg = sys . modules . get ( pkgname )
pkg = sys . modules . get ( pkgname )
if pkgname and getattr ( pkg , ' __loader__ ' , None ) is not self :
if pkgname and getattr ( pkg , ' __loader__ ' , None ) is not self :
@ -701,6 +695,12 @@ class Importer(object):
_v and LOG . debug ( ' %r : master doesn \' t know %r ' , self , fullname )
_v and LOG . debug ( ' %r : master doesn \' t know %r ' , self , fullname )
return None
return None
# #114: explicitly whitelisted prefixes override any
# system-installed package.
if self . whitelist != [ ' ' ] :
if any ( fullname . startswith ( s ) for s in self . whitelist ) :
return self
try :
try :
self . builtin_find_module ( fullname )
self . builtin_find_module ( fullname )
_vv and IOLOG . debug ( ' %r : %r is available locally ' ,
_vv and IOLOG . debug ( ' %r : %r is available locally ' ,