mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +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
|
@ -151,8 +151,8 @@ def exists(path):
|
|||
try:
|
||||
st = os.stat(path)
|
||||
except os.error:
|
||||
return 0
|
||||
return 1
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def isdir(path):
|
||||
|
@ -161,7 +161,7 @@ def isdir(path):
|
|||
try:
|
||||
st = os.stat(path)
|
||||
except os.error:
|
||||
return 0
|
||||
return False
|
||||
return stat.S_ISDIR(st[stat.ST_MODE])
|
||||
|
||||
|
||||
|
@ -171,7 +171,7 @@ def isfile(path):
|
|||
try:
|
||||
st = os.stat(path)
|
||||
except os.error:
|
||||
return 0
|
||||
return False
|
||||
return stat.S_ISREG(st[stat.ST_MODE])
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue