diff options
| author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-04-02 00:25:14 (GMT) |
|---|---|---|
| committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-04-02 00:25:14 (GMT) |
| commit | 4d0c1170ef1eb0d0acbbcc6da0fa5a7c6cba4a10 (patch) | |
| tree | 359cee99e8f511f9402ebdad94a124b846bd96f4 /Lib/idlelib/ScrolledList.py | |
| parent | b1ba750226fc11937bb1efdfefa4df1844120063 (diff) | |
| download | cpython-4d0c1170ef1eb0d0acbbcc6da0fa5a7c6cba4a10.zip cpython-4d0c1170ef1eb0d0acbbcc6da0fa5a7c6cba4a10.tar.gz cpython-4d0c1170ef1eb0d0acbbcc6da0fa5a7c6cba4a10.tar.bz2 | |
Correct the apparent refleak in test_io:
When cls is an ABCMeta, every call to isinstance(x, cls)
records type(x) in the cls._abc_cache of cls_abc_negative_cache.
So we clear these caches at the end of the test.
inspect.isabstract() is not the correct test for all ABCs, because there is no @abstractmethod in io.py (why?)
isinstance(cls, ABCMeta) would be more exact, but it fails with an infinite recursion.
So I used a hack to determine whether a class is an ABCMeta.
The true correction would be to turn cls._abc_cache &co into a WeakSet, as py3k does.
But classic classes are not weak referenceable...
Of course, this change should not be merged into the py3k branch.
Diffstat (limited to 'Lib/idlelib/ScrolledList.py')
0 files changed, 0 insertions, 0 deletions
