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.
This commit is contained in:
Antoine Pitrou 2011-02-28 22:03:34 +00:00
parent cfbcec3823
commit fcf81fd031
4 changed files with 14 additions and 1 deletions

View file

@ -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);