importer: Don't respond to non-.py[co] imports.

pull/45/head
David Wilson 8 years ago
parent 031c0f3cf4
commit 9e2c74eebc

@ -416,7 +416,12 @@ class ModuleFinder(object):
if 'six.moves' in fullname:
# TODO: causes inspect.getsource() to explode.
return
return None, None, None
modpath = getattr(sys.modules[fullname], '__file__', '')
if not modpath.rstrip('co').endswith('.py'):
# Probably a native module.
return None, None, None
is_pkg = hasattr(sys.modules[fullname], '__path__')
try:

Loading…
Cancel
Save