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:
Takafumi Arakaki
2013-03-15 14:36:12 +01:00
parent cd513590ab
commit c25ee531a2

View File

@@ -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()