~divmod-dev/divmod.org/830343-optional-pycrypto

Viewing all changes in revision 2711.

Change FinalizingCache to cope with PyPy weakref callback behaviour.

Author: mithrandi
Reviewer: exarkun, lvh

On CPython, weakref callbacks always run before any other code has a chance to
observe the broken weakref. On PyPy, this is not the case; code may run between
the weakref being broken, and the weakref callback being run, thus potentially
encountering a weakref which is broken but has not (yet) had its callback
invoked. This branch makes changes to tolerate this situation.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: