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())
|
||||
# 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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -157,3 +157,18 @@ def empty_assert():
|
||||
x
|
||||
|
||||
import datetime as
|
||||
|
||||
|
||||
# -----------------
|
||||
# statements
|
||||
# -----------------
|
||||
|
||||
call = ''
|
||||
invalid = .call
|
||||
#? str()
|
||||
invalid
|
||||
|
||||
call = ''
|
||||
invalid = call?.call
|
||||
#? str()
|
||||
invalid
|
||||
|
||||
Reference in New Issue
Block a user