[New-bugs-announce] [issue3339] dummy_thread LockType.acquire() always returns None, should be True or False

Henk Punt report at bugs.python.org
Fri Jul 11 09:52:35 CEST 2008


New submission from Henk Punt <henkpunt at gmail.com>:

Class LockType always seems to be returning None if waitflag is not
specified.

If you look up the documentation for the non dummy lock in lib ref
15.3.1 , none of the possible
results should be ‘None’, in fact it would always return True, except
when non-block is specified
And another thread is already holding the lock then it would return False

>From the docs on acquire():

Acquire a lock, blocking or non-blocking. 
When invoked without arguments, block until the lock is unlocked, then
set it to locked, and return true. 
When invoked with the blocking argument set to true, do the same thing
as when called without arguments, and return true. 
When invoked with the blocking argument set to false, do not block. If a
call without an argument would block, return false immediately;
otherwise, do the same thing as when called without arguments, and
return true.

----------
components: Library (Lib)
messages: 69539
nosy: toymachine
severity: normal
status: open
title: dummy_thread LockType.acquire() always returns None, should be True or False
type: behavior
versions: Python 2.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3339>
_______________________________________


More information about the New-bugs-announce mailing list