forked from VimPlug/jedi
Error token handling with dots in front.
This commit is contained in:
@@ -335,7 +335,7 @@ class _Importer(object):
|
|||||||
content = common.source_to_unicode(f.read())
|
content = common.source_to_unicode(f.read())
|
||||||
# these are strings that need to be used for namespace packages,
|
# these are strings that need to be used for namespace packages,
|
||||||
# the first one is ``pkgutil``, the second ``pkg_resources``.
|
# 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:
|
if options[0] in content or options[1] in content:
|
||||||
# It is a namespace, now try to find the rest of the modules.
|
# It is a namespace, now try to find the rest of the modules.
|
||||||
return follow_path(iter(import_path), sys.path)
|
return follow_path(iter(import_path), sys.path)
|
||||||
|
|||||||
@@ -1143,6 +1143,7 @@ isinstance(c, (tokenize.Token, Operator)) else unicode(c)
|
|||||||
else:
|
else:
|
||||||
# comments, strange tokens (like */**), error tokens to
|
# comments, strange tokens (like */**), error tokens to
|
||||||
# reproduce the string correctly.
|
# reproduce the string correctly.
|
||||||
|
is_chain = False
|
||||||
result.append(tok)
|
result.append(tok)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|||||||
@@ -157,3 +157,18 @@ def empty_assert():
|
|||||||
x
|
x
|
||||||
|
|
||||||
import datetime as
|
import datetime as
|
||||||
|
|
||||||
|
|
||||||
|
# -----------------
|
||||||
|
# statements
|
||||||
|
# -----------------
|
||||||
|
|
||||||
|
call = ''
|
||||||
|
invalid = .call
|
||||||
|
#? str()
|
||||||
|
invalid
|
||||||
|
|
||||||
|
call = ''
|
||||||
|
invalid = call?.call
|
||||||
|
#? str()
|
||||||
|
invalid
|
||||||
|
|||||||
Reference in New Issue
Block a user