1
0
forked from VimPlug/jedi

Fix an exception in the flask ext code.

This commit is contained in:
Albertas Agejevas
2014-07-27 13:43:20 +02:00
parent a18f8a7cbb
commit 5edd2274b2
2 changed files with 6 additions and 1 deletions

View File

@@ -345,7 +345,8 @@ class _Importer(object):
def follow_file_system(self):
# Handle "magic" Flask extension imports:
# ``flask.ext.foo`` is really ``flask_foo`` or ``flaskext.foo``.
if [part._string for part in self.import_path[:2]] == ['flask', 'ext']:
if len(self.import_path) > 2 and \
[part._string for part in self.import_path[:2]] == ['flask', 'ext']:
orig_path = tuple(self.import_path)
part = orig_path[2]
pos = (part._line, part._column)