diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2016-12-18 12:14:03 +0200 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2016-12-18 12:14:14 +0200 |
commit | 49c9dcfd103fdf28b37f686a14be755ed1ff1058 (patch) | |
tree | da51612aa0b558ae61e317cacffe31098214149c | |
parent | 9e65cf919eaeba6fb5c4e9b823b9d429be7fa0eb (diff) | |
download | astroid-git-49c9dcfd103fdf28b37f686a14be755ed1ff1058.tar.gz |
Make sure we don't convert a None object to a list.
-rw-r--r-- | astroid/interpreter/_import/spec.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/astroid/interpreter/_import/spec.py b/astroid/interpreter/_import/spec.py index 73b273dc..7b5b8a0e 100644 --- a/astroid/interpreter/_import/spec.py +++ b/astroid/interpreter/_import/spec.py @@ -83,9 +83,10 @@ class ImpFinder(Finder): """A finder based on the imp module.""" 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 |