mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 05:54:25 +08:00
Make sure that scopes can only be exact values, see #1590
This commit is contained in:
@@ -513,6 +513,8 @@ class Script(object):
|
||||
"""
|
||||
|
||||
def _references(include_builtins=True, scope='project'):
|
||||
if scope not in ('project', 'file'):
|
||||
raise ValueError('Only the scopes "file" and "project" are allowed')
|
||||
tree_name = self._module_node.get_name_of_position((line, column))
|
||||
if tree_name is None:
|
||||
# Must be syntax
|
||||
|
||||
Reference in New Issue
Block a user