diff options
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 |