mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
threading.RLock._acquire_restore() now raises a TypeError instead of a
SystemError when it is not called with 2 arguments
This commit is contained in:
parent
f4c68db162
commit
e8794526db
1 changed files with 3 additions and 3 deletions
|
@ -379,13 +379,13 @@ current thread, release() needs to be called as many times for the lock\n\
|
||||||
to be available for other threads.");
|
to be available for other threads.");
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
rlock_acquire_restore(rlockobject *self, PyObject *arg)
|
rlock_acquire_restore(rlockobject *self, PyObject *args)
|
||||||
{
|
{
|
||||||
long owner;
|
long owner;
|
||||||
unsigned long count;
|
unsigned long count;
|
||||||
int r = 1;
|
int r = 1;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple(arg, "kl:_acquire_restore", &count, &owner))
|
if (!PyArg_ParseTuple(args, "(kl):_acquire_restore", &count, &owner))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!PyThread_acquire_lock(self->rlock_lock, 0)) {
|
if (!PyThread_acquire_lock(self->rlock_lock, 0)) {
|
||||||
|
@ -488,7 +488,7 @@ static PyMethodDef rlock_methods[] = {
|
||||||
{"_is_owned", (PyCFunction)rlock_is_owned,
|
{"_is_owned", (PyCFunction)rlock_is_owned,
|
||||||
METH_NOARGS, rlock_is_owned_doc},
|
METH_NOARGS, rlock_is_owned_doc},
|
||||||
{"_acquire_restore", (PyCFunction)rlock_acquire_restore,
|
{"_acquire_restore", (PyCFunction)rlock_acquire_restore,
|
||||||
METH_O, rlock_acquire_restore_doc},
|
METH_VARARGS, rlock_acquire_restore_doc},
|
||||||
{"_release_save", (PyCFunction)rlock_release_save,
|
{"_release_save", (PyCFunction)rlock_release_save,
|
||||||
METH_NOARGS, rlock_release_save_doc},
|
METH_NOARGS, rlock_release_save_doc},
|
||||||
{"__enter__", (PyCFunction)rlock_acquire,
|
{"__enter__", (PyCFunction)rlock_acquire,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue