1
0
forked from VimPlug/jedi

Fix the compatibility docstring

This commit is contained in:
Dave Halter
2020-07-02 01:58:38 +02:00
parent 9838040ca3
commit 782c561e86
12 changed files with 13 additions and 33 deletions

View File

@@ -201,11 +201,8 @@ def _infer_for_statement_string(module_context, string):
# (e.g., 'threading' in 'threading.Thread').
string = 'import %s\n' % element + string
# Take the default grammar here, if we load the Python 2.7 grammar here, it
# will be impossible to use `...` (Ellipsis) as a token. Docstring types
# don't need to conform with the current grammar.
debug.dbg('Parse docstring code %s', string, color='BLUE')
grammar = module_context.inference_state.latest_grammar
grammar = module_context.inference_state.grammar
try:
module = grammar.parse(code.format(indent_block(string)), error_recovery=False)
except ParserSyntaxError: