issue #477: ModuleFinder test fixes.

issue510
David Wilson 6 years ago
parent c443244986
commit 7ecd5d8ba3

@ -476,7 +476,7 @@ class ModuleFinder(object):
# else we could return junk.
return
pkgname, _, modname = str_partition(fullname, '.')
pkgname, _, modname = str_rpartition(to_text(fullname), u'.')
pkg = sys.modules.get(pkgname)
if pkg is None or not hasattr(pkg, '__file__'):
return
@ -492,6 +492,7 @@ class ModuleFinder(object):
source = fp.read()
finally:
if fp:
fp.close()
if isinstance(source, mitogen.core.UnicodeType):
@ -571,7 +572,7 @@ class ModuleFinder(object):
def generate_parent_names(self, fullname):
while '.' in fullname:
fullname, _, _ = str_partition(fullname, u'.')
fullname, _, _ = str_rpartition(to_text(fullname), u'.')
yield fullname
def find_related_imports(self, fullname):

Loading…
Cancel
Save