commit | c2824d41c32c3be5f100acdb1ff9f71ba7336b60 | [log] [tgz] |
---|---|---|
author | Victor Stinner <victor.stinner@haypocalc.com> | Sun Apr 24 23:41:33 2011 +0200 |
committer | Victor Stinner <victor.stinner@haypocalc.com> | Sun Apr 24 23:41:33 2011 +0200 |
tree | ecc2204a2c49dbbb3eba73212218fbf244b725a9 | |
parent | a82aa55b5e5448f93fd1827d97752e19877db077 [diff] [blame] |
Issue #11915: threading.RLock()._release_save() raises a RuntimeError if the lock was not acquired.
diff --git a/Lib/threading.py b/Lib/threading.py index eb3cb62..28c2146 100644 --- a/Lib/threading.py +++ b/Lib/threading.py
@@ -157,6 +157,8 @@ 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