Issue 3339: dummy_thread LockType.acquire() always returns None, should be True or False (original) (raw)
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.
r64903-64905 have the fixes for trunk, 3.0, and 2.5, respectively. Thanks for reporting this, Henk. Andrii, I never even looked at your patch since while I was evaluating the bug the problem was rather obvious and simple, as you said. =) Thanks for the work, though.