summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2016-12-18 12:14:03 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2016-12-18 12:14:14 +0200
commit49c9dcfd103fdf28b37f686a14be755ed1ff1058 (patch)
treeda51612aa0b558ae61e317cacffe31098214149c
parent9e65cf919eaeba6fb5c4e9b823b9d429be7fa0eb (diff)
downloadastroid-git-49c9dcfd103fdf28b37f686a14be755ed1ff1058.tar.gz
Make sure we don't convert a None object to a list.
-rw-r--r--astroid/interpreter/_import/spec.py5
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