Commit 0dbb1ec0 authored by David Wilson's avatar David Wilson

importer: warn once about missing source and cache negative hit

parent a0d9d342
...@@ -348,9 +348,13 @@ class ModuleFinder(object): ...@@ -348,9 +348,13 @@ class ModuleFinder(object):
for method in self.get_module_methods: for method in self.get_module_methods:
tup = method(self, fullname) tup = method(self, fullname)
if tup: if tup:
return tup break
else:
tup = None, None, None
LOG.warning('get_module_source(%r): cannot find source', fullname)
return None, None, None self._found_cache[fullname] = tup
return tup
def resolve_relpath(self, fullname, level): def resolve_relpath(self, fullname, level):
"""Given an ImportFrom AST node, guess the prefix that should be tacked """Given an ImportFrom AST node, guess the prefix that should be tacked
...@@ -388,7 +392,6 @@ class ModuleFinder(object): ...@@ -388,7 +392,6 @@ class ModuleFinder(object):
modpath, src, _ = self.get_module_source(fullname) modpath, src, _ = self.get_module_source(fullname)
if src is None: if src is None:
LOG.warning('%r: cannot find source for %r', self, fullname)
return [] return []
maybe_names = list(self.generate_parent_names(fullname)) maybe_names = list(self.generate_parent_names(fullname))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment