Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e2fbeb3 + 8289514 commit 32fe716Copy full SHA for 32fe716
lib/matplotlib/testing/decorators.py
@@ -308,10 +308,15 @@ def find_dotted_module(module_name, path=None):
308
"""A version of imp which can handle dots in the module name"""
309
res = None
310
for sub_mod in module_name.split('.'):
311
- res = file, path, _ = imp.find_module(sub_mod, path)
312
- path = [path]
313
- if file is not None:
314
- file.close()
+ try:
+ res = file, path, _ = imp.find_module(sub_mod, path)
+ path = [path]
+ if file is not None:
315
+ file.close()
316
+ except ImportError:
317
+ # assume namespace package
318
+ path = sys.modules[sub_mod].__path__
319
+ res = None, path, None
320
return res
321
322
mod_file = find_dotted_module(func.__module__)[1]
0 commit comments