1
0
forked from VimPlug/jedi
Files
jedi-fork/jedi/api.py
Takafumi Arakaki 7cf70a3f0a Do not clear cache in __del__
Prior to this change, running
`py.test --assert=rewrite test/test_integration.py` fails with errors
due to:

```py
cls = <class 'jedi.recursion.ExecutionRecursionDecorator'>

    @classmethod
    def cleanup(cls):
>       cls.parent_execution_funcs.pop()
E       IndexError: pop from empty list

recursion.py:127: IndexError
```

Similar errors occurred in travis occasionally:
- https://travis-ci.org/davidhalter/jedi/jobs/5449831
- https://travis-ci.org/davidhalter/jedi/jobs/5512538

I think this is because GC calls __del__ at random point during
actual execution of ExecutionRecursionDecorator.__call__.
As --assert=rewrite works by AST dynamically, I guess that it
is harder for Python's GC to clean up code and therefore GC
happens sometime later.  Although this is just a random guess,
as `tox -- --assert=rewrite` works with this patch now, I think
this is a good change.
2013-03-15 00:21:46 +01:00

21 KiB