mirror of
https://github.com/python/cpython.git
synced 2025-08-29 05:05:03 +00:00
Convert a pile of obvious "yes/no" functions to return bool.
This commit is contained in:
parent
2f486b7fa6
commit
bc0e910826
34 changed files with 117 additions and 122 deletions
|
@ -139,13 +139,13 @@ def isfile(s):
|
|||
|
||||
|
||||
def exists(s):
|
||||
"""Return true if the pathname refers to an existing file or directory."""
|
||||
"""Return True if the pathname refers to an existing file or directory."""
|
||||
|
||||
try:
|
||||
st = os.stat(s)
|
||||
except os.error:
|
||||
return 0
|
||||
return 1
|
||||
return False
|
||||
return True
|
||||
|
||||
# Return the longest prefix of all list elements.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue