diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2016-12-18 12:14:03 +0200 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2016-12-30 13:29:37 +0200 |
commit | 4cecab0e15d5ed84cdc8f26a372069ce2189eba7 (patch) | |
tree | 9f1f1c4adf3b386eeea49d8ccd671049f94ab758 | |
parent | 804bbbad544564a03cb59d52282177944989c5b1 (diff) | |
download | astroid-git-4cecab0e15d5ed84cdc8f26a372069ce2189eba7.tar.gz |
Make sure we don't convert a None object to a list.
-rw-r--r-- | astroid/interpreter/_import/spec.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/astroid/interpreter/_import/spec.py b/astroid/interpreter/_import/spec.py index 6a79550e..9c3b8cf2 100644 --- a/astroid/interpreter/_import/spec.py +++ b/astroid/interpreter/_import/spec.py @@ -82,10 +82,12 @@ class Finder(object): class ImpFinder(Finder): """A finder based on the imp module.""" - def find_module(self, modname, _, processed, submodule_path): + def find_module(self, modname, module_parts, processed, submodule_path): + if submodule_path is not None: + submodule_path = list(submodule_path) + try: - stream, mp_filename, mp_desc = imp.find_module( - modname, list(submodule_path)) + stream, mp_filename, mp_desc = imp.find_module(modname, submodule_path) except ImportError: return None |