importer: take priority over system packages when whitelisting is enabled

Might want to de-overload the meaning of whitelist in future, but in
the meantime it works fine for Ansible and I can't think of a
whitelisting use case that would break because of it.

Closes #114.
pull/120/head
David Wilson 7 years ago
parent d04144e56c
commit a9c6c139b4

@ -482,6 +482,11 @@ class Importer(object):
self, fullname)
return None
# #114: explicitly whitelisted prefixes override any
# system-installed package.
if self.whitelist and not is_blacklisted_import(self, fullname):
return self
try:
self.builtin_find_module(fullname)
_v and LOG.debug('%r: %r is available locally', self, fullname)

Loading…
Cancel
Save