From bc0e9108261693b6278687f4fb4709ff76c2e543 Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Thu, 4 Apr 2002 22:55:58 +0000 Subject: Convert a pile of obvious "yes/no" functions to return bool. --- Lib/posixpath.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Lib/posixpath.py') diff --git a/Lib/posixpath.py b/Lib/posixpath.py index c342bbcf198..cceb2d2be71 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. -- cgit v1.2.3