summaryrefslogtreecommitdiff
path: root/Lib/threading.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-04-24 23:41:33 +0200
committerVictor Stinner <victor.stinner@haypocalc.com>2011-04-24 23:41:33 +0200
commitc2824d41c32c3be5f100acdb1ff9f71ba7336b60 (patch)
treeecc2204a2c49dbbb3eba73212218fbf244b725a9 /Lib/threading.py
parenta82aa55b5e5448f93fd1827d97752e19877db077 (diff)
downloadcpython-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.py2
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