forked from VimPlug/jedi
settings should not be affected by exceptions.
This commit is contained in:
@@ -511,6 +511,7 @@ class Script(object):
|
||||
"""
|
||||
temp, settings.dynamic_flow_information = \
|
||||
settings.dynamic_flow_information, False
|
||||
try:
|
||||
user_stmt = self._parser.user_stmt()
|
||||
definitions, search_name = self._goto(add_import_name=True)
|
||||
if isinstance(user_stmt, pr.Statement):
|
||||
@@ -521,7 +522,9 @@ class Script(object):
|
||||
if unicode(v.names[-1]) == search_name]
|
||||
if not isinstance(user_stmt, pr.Import):
|
||||
# import case is looked at with add_import_name option
|
||||
definitions = usages.usages_add_import_modules(self._evaluator, definitions, search_name)
|
||||
definitions = usages.usages_add_import_modules(self._evaluator,
|
||||
definitions,
|
||||
search_name)
|
||||
|
||||
module = set([d.get_parent_until() for d in definitions])
|
||||
module.add(self._parser.module())
|
||||
@@ -534,8 +537,9 @@ class Script(object):
|
||||
names.append(classes.Definition(self._evaluator, d))
|
||||
else:
|
||||
names.append(classes.Definition(self._evaluator, name_part))
|
||||
|
||||
finally:
|
||||
settings.dynamic_flow_information = temp
|
||||
|
||||
return helpers.sorted_definitions(set(names))
|
||||
|
||||
def call_signatures(self):
|
||||
|
||||
@@ -92,7 +92,9 @@ def scale_speed_settings(factor):
|
||||
b = settings.max_until_execution_unique
|
||||
settings.max_executions *= factor
|
||||
settings.max_until_execution_unique *= factor
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
settings.max_executions = a
|
||||
settings.max_until_execution_unique = b
|
||||
|
||||
|
||||
Reference in New Issue
Block a user