diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-02-28 22:03:34 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-02-28 22:03:34 (GMT) |
commit | fcf81fd0310ba505c46d33a82f2b782578ed1a98 (patch) | |
tree | 8cdb6d911947e46dd99ac99a08a82cb736c4006e /Modules/_threadmodule.c | |
parent | cfbcec3823892759017c1f3a1d1cb7fab4e84f69 (diff) | |
download | cpython-fcf81fd0310ba505c46d33a82f2b782578ed1a98.zip cpython-fcf81fd0310ba505c46d33a82f2b782578ed1a98.tar.gz cpython-fcf81fd0310ba505c46d33a82f2b782578ed1a98.tar.bz2 |
Issue #11140: Lock.release() now raises a RuntimeError when attempting
to release an unacquired lock, as claimed in the threading documentation.
The _thread.error exception is now an alias of RuntimeError.
Diffstat (limited to 'Modules/_threadmodule.c')
-rw-r--r-- | Modules/_threadmodule.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c index 2d3be5d..14ed55e 100644 --- a/Modules/_threadmodule.c +++ b/Modules/_threadmodule.c @@ -1308,7 +1308,9 @@ PyInit__thread(void) /* Add a symbolic constant */ d = PyModule_GetDict(m); - ThreadError = PyErr_NewException("_thread.error", NULL, NULL); + ThreadError = PyExc_RuntimeError; + Py_INCREF(ThreadError); + PyDict_SetItemString(d, "error", ThreadError); Locktype.tp_doc = lock_doc; Py_INCREF(&Locktype); |