summaryrefslogtreecommitdiffstats
path: root/Lib/posixpath.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2002-04-04 22:55:58 (GMT)
committerTim Peters <tim.peters@gmail.com>2002-04-04 22:55:58 (GMT)
commitbc0e9108261693b6278687f4fb4709ff76c2e543 (patch)
treeafef5d4734034ed0268950cf06321aefd4154ff3 /Lib/posixpath.py
parent2f486b7fa6451b790b154e6e4751239d69d46952 (diff)
downloadcpython-bc0e9108261693b6278687f4fb4709ff76c2e543.zip
cpython-bc0e9108261693b6278687f4fb4709ff76c2e543.tar.gz
cpython-bc0e9108261693b6278687f4fb4709ff76c2e543.tar.bz2
Convert a pile of obvious "yes/no" functions to return bool.
Diffstat (limited to 'Lib/posixpath.py')
-rw-r--r--Lib/posixpath.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/posixpath.py b/Lib/posixpath.py
index c342bbc..cceb2d2 100644
--- a/Lib/posixpath.py
+++ b/Lib/posixpath.py
@@ -166,12 +166,12 @@ def islink(path):
# This is false for dangling symbolic links.
def exists(path):
- """Test whether a path exists. Returns false for broken symbolic links"""
+ """Test whether a path exists. Returns False for broken symbolic links"""
try:
st = os.stat(path)
except os.error:
- return 0
- return 1
+ return False
+ return True
# Is a path a directory?
@@ -237,16 +237,16 @@ def ismount(path):
s1 = os.stat(path)
s2 = os.stat(join(path, '..'))
except os.error:
- return 0 # It doesn't exist -- so not a mount point :-)
+ return False # It doesn't exist -- so not a mount point :-)
dev1 = s1[stat.ST_DEV]
dev2 = s2[stat.ST_DEV]
if dev1 != dev2:
- return 1 # path/.. on a different device as path
+ return True # path/.. on a different device as path
ino1 = s1[stat.ST_INO]
ino2 = s2[stat.ST_INO]
if ino1 == ino2:
- return 1 # path/.. is the same i-node as path
- return 0
+ return True # path/.. is the same i-node as path
+ return False
# Directory tree walk.