diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-04-24 23:41:33 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-04-24 23:41:33 +0200 |
commit | c2824d41c32c3be5f100acdb1ff9f71ba7336b60 (patch) | |
tree | ecc2204a2c49dbbb3eba73212218fbf244b725a9 /Lib/threading.py | |
parent | a82aa55b5e5448f93fd1827d97752e19877db077 (diff) | |
download | cpython-git-c2824d41c32c3be5f100acdb1ff9f71ba7336b60.tar.gz |
Issue #11915: threading.RLock()._release_save() raises a RuntimeError if the
lock was not acquired.
Diffstat (limited to 'Lib/threading.py')
-rw-r--r-- | Lib/threading.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/threading.py b/Lib/threading.py index eb3cb626c3..28c2146671 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -157,6 +157,8 @@ class _RLock(_Verbose): def _release_save(self): if __debug__: self._note("%s._release_save()", self) + if self._count == 0: + raise RuntimeError("cannot release un-acquired lock") count = self._count self._count = 0 owner = self._owner |