Commit d4a546dc authored by Alex Willmer's avatar Alex Willmer Committed by David Wilson

parent: Fix ModuleForwarder not sending related packages

Found due to a LGTM warning about unused loop variable (related). As far
as I can tell the callback was sending fullname multiple times. KeyError
check added because I found NestedTest failed - mitogen.parent had
mitogen as one of it's related, and mitogen was not in the cache.

Refs #61
parent 227cd3aa
......@@ -519,7 +519,14 @@ class ModuleForwarder(object):
tup = self.importer._cache[fullname]
if tup is not None:
for related in tup[4]:
rtup = self.importer._cache[fullname]
LOG.debug('%r._on_get_module(): trying related %r',
self, related)
try:
rtup = self.importer._cache[related]
except KeyError:
LOG.warn('%r._on_get_module(): skipping %r, not in cache',
self, related)
continue
self._send_one_module(msg, rtup)
self._send_one_module(msg, tup)
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