comparison i18n/polib.py @ 29928:e5a97ec6ebb8

journal: properly check for held lock (issue5349) The 'jlock' code meant to check for a held lock, but it actually just checking for a lock object. With CPython, this worked because the 'jlock' object is not referenced outside the '_write' function so reference counting would garbage collect it and the '_lockref' would return None. With pypy, the garbage collection would happen at an undefined time and the '_lockref' can still point to a 'jlock' object outside of '_write'. The right thing to do here is not only to check for a lock object but also to check if the lock is held. We update the code to do so and reuse a utility method that exist on 'localrepo' to help readability. This fix journal related tests with pypy.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Tue, 13 Sep 2016 20:30:19 +0200
parents 6a98f9408a50
children a7310a477966
comparison
equal deleted inserted replaced
29927:799e36749f1a 29928:e5a97ec6ebb8