davidhalter/jedi — pull request #173 by tkf (2013-03-14 23:25:26+00:00)
Title: 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 =

@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.