mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-15999: Clean up of handling boolean arguments. (GH-15610)
* Use the 'p' format unit instead of manually called PyObject_IsTrue(). * Pass boolean value instead 0/1 integers to functions that needs boolean. * Convert some arguments to boolean only once.
This commit is contained in:
parent
5eca7f3f38
commit
1f21eaa15e
21 changed files with 69 additions and 78 deletions
|
@ -262,7 +262,7 @@ class Condition:
|
|||
def _is_owned(self):
|
||||
# Return True if lock is owned by current_thread.
|
||||
# This method is called only if _lock doesn't have _is_owned().
|
||||
if self._lock.acquire(0):
|
||||
if self._lock.acquire(False):
|
||||
self._lock.release()
|
||||
return False
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue