[Python-checkins] cpython: threading.RLock._acquire_restore() now raises a TypeError instead of a

victor.stinner python-checkins at python.org
Thu Jan 2 12:54:03 CET 2014


http://hg.python.org/cpython/rev/9a61be172c23
changeset:   88249:9a61be172c23
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Thu Jan 02 12:47:24 2014 +0100
summary:
  threading.RLock._acquire_restore() now raises a TypeError instead of a
SystemError when it is not called with 2 arguments

files:
  Modules/_threadmodule.c |  6 +++---
  1 files changed, 3 insertions(+), 3 deletions(-)


diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c
--- a/Modules/_threadmodule.c
+++ b/Modules/_threadmodule.c
@@ -379,13 +379,13 @@
 to be available for other threads.");
 
 static PyObject *
-rlock_acquire_restore(rlockobject *self, PyObject *arg)
+rlock_acquire_restore(rlockobject *self, PyObject *args)
 {
     long owner;
     unsigned long count;
     int r = 1;
 
-    if (!PyArg_ParseTuple(arg, "kl:_acquire_restore", &count, &owner))
+    if (!PyArg_ParseTuple(args, "(kl):_acquire_restore", &count, &owner))
         return NULL;
 
     if (!PyThread_acquire_lock(self->rlock_lock, 0)) {
@@ -488,7 +488,7 @@
     {"_is_owned",     (PyCFunction)rlock_is_owned,
      METH_NOARGS, rlock_is_owned_doc},
     {"_acquire_restore", (PyCFunction)rlock_acquire_restore,
-     METH_O, rlock_acquire_restore_doc},
+     METH_VARARGS, rlock_acquire_restore_doc},
     {"_release_save", (PyCFunction)rlock_release_save,
      METH_NOARGS, rlock_release_save_doc},
     {"__enter__",    (PyCFunction)rlock_acquire,

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list