mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
AttributeError: 'Generator' object has no attribute 'start_pos'
Running py.test raises this error:
```tb
test/test_api_classes.py:50: in <module>
> @pytest.mark.parametrize('definition', make_definitions())
test/test_api_classes.py:38: in make_definitions
> definitions += script.definition()
jedi/api_classes.py:44: in wrapper
> result = func(*args, **kwds)
jedi/api.py:274: in definition
> if not isinstance(s, imports.ImportPath._GlobalNamespace)])
jedi/api_classes.py:418: in __init__
> super(Definition, self).__init__(definition, definition.start_pos)
E AttributeError: 'Generator' object has no attribute 'start_pos'
```
This commit is contained in:
@@ -32,7 +32,7 @@ def make_definitions():
|
||||
definitions += api.defined_names(source)
|
||||
|
||||
source += textwrap.dedent("""
|
||||
variable = sys or C or x or f or g or h""")
|
||||
variable = sys or C or x or f or g or g() or h""")
|
||||
lines = source.splitlines()
|
||||
script = api.Script(source, len(lines), len('variable'), None)
|
||||
definitions += script.definition()
|
||||
|
||||
Reference in New Issue
Block a user