Bugs item #1209880, was opened at 2005-05-27 16:04
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1209880&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Chris Perkins (cperkins)
Assigned to: Nobody/Anonymous (nobody)
Summary: doc bug in Lock.acquire
Initial Comment:
The docs for the acquire method in both the thread and
threading modules are incorrect. They describe an old
(insane) version that returned None when called with no
argument. It appears that acquire is now sane, and
always returns True or False.
----------------------------------------------------------------------
>Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-05-31 11:33
Message:
Logged In: YES
user_id=1188172
It certainly seems that there is a code path in Lock.acquire
that can return None, as the following excerpt from
Modules/threadmodule.c shows:
static PyObject *
lock_PyThread_acquire_lock(lockobject *self, PyObject *args)
{
int i = 1;
if (!PyArg_ParseTuple(args, "|i:acquire", &i))
return NULL;
Py_BEGIN_ALLOW_THREADS
i = PyThread_acquire_lock(self->lock_lock, i);
Py_END_ALLOW_THREADS
if (args == NULL) {
Py_INCREF(Py_None);
return Py_None;
}
else
return PyBool_FromLong((long)i);
}
Nevertheless, a_lock.acquire() still returns true.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1209880&group_id=5470
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com