Convert a pile of obvious "yes/no" functions to return bool.

This commit is contained in:
Tim Peters 2002-04-04 22:55:58 +00:00
parent 2f486b7fa6
commit bc0e910826
34 changed files with 117 additions and 122 deletions

View file

@ -24,12 +24,12 @@ class mutex:
def testandset(self):
"""Atomic test-and-set -- grab the lock if it is not set,
return true if it succeeded."""
return True if it succeeded."""
if not self.locked:
self.locked = 1
return 1
return True
else:
return 0
return False
def lock(self, function, argument):
"""Lock a mutex, call the function with supplied argument