1
0
forked from VimPlug/jedi

Error token handling with dots in front.

This commit is contained in:
Dave Halter
2014-05-03 12:39:20 +02:00
parent e5326acf8f
commit c44b88adc3
3 changed files with 17 additions and 1 deletions

View File

@@ -335,7 +335,7 @@ class _Importer(object):
content = common.source_to_unicode(f.read())
# these are strings that need to be used for namespace packages,
# the first one is ``pkgutil``, the second ``pkg_resources``.
options = 'declare_namespace(__name__)', 'extend_path(__path__'
options = ('declare_namespace(__name__)', 'extend_path(__path__')
if options[0] in content or options[1] in content:
# It is a namespace, now try to find the rest of the modules.
return follow_path(iter(import_path), sys.path)

View File

@@ -1143,6 +1143,7 @@ isinstance(c, (tokenize.Token, Operator)) else unicode(c)
else:
# comments, strange tokens (like */**), error tokens to
# reproduce the string correctly.
is_chain = False
result.append(tok)
return result

View File

@@ -157,3 +157,18 @@ def empty_assert():
x
import datetime as
# -----------------
# statements
# -----------------
call = ''
invalid = .call
#? str()
invalid
call = ''
invalid = call?.call
#? str()
invalid