diff options
author | Damien George <damien.p.george@gmail.com> | 2017-06-14 14:43:50 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-06-14 14:43:50 +1000 |
commit | e374cfff80c37b96b03d4438e475e405b03e6d61 (patch) | |
tree | d9c71b8cb37d3ce11eecaa4bbee81923d66e955e /tests/thread/thread_lock1.py | |
parent | a47b8711316a4901bc81e1c46ce50de00207c47f (diff) |
py/modthread: Raise RuntimeError in release() if lock is not acquired.
Diffstat (limited to 'tests/thread/thread_lock1.py')
-rw-r--r-- | tests/thread/thread_lock1.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/thread/thread_lock1.py b/tests/thread/thread_lock1.py index ca585ffbb..ba5c7dff0 100644 --- a/tests/thread/thread_lock1.py +++ b/tests/thread/thread_lock1.py @@ -38,3 +38,9 @@ try: except KeyError: print('KeyError') print(lock.locked()) + +# test that we can't release an unlocked lock +try: + lock.release() +except RuntimeError: + print('RuntimeError') |