diff options
Diffstat (limited to 'Demo/threads/find.py')
-rw-r--r-- | Demo/threads/find.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Demo/threads/find.py b/Demo/threads/find.py index 68ca155..57fe81e 100644 --- a/Demo/threads/find.py +++ b/Demo/threads/find.py @@ -123,7 +123,7 @@ def main(): def selector(dir, name, fullname, stat): # Look for world writable files that are not symlinks - return (stat[ST_MODE] & 0002) != 0 and not S_ISLNK(stat[ST_MODE]) + return (stat[ST_MODE] & 0o002) != 0 and not S_ISLNK(stat[ST_MODE]) # The find procedure -- calls wq.addwork() for subdirectories @@ -132,7 +132,7 @@ def find(dir, pred, wq): try: names = os.listdir(dir) except os.error as msg: - print repr(dir), ':', msg + print(repr(dir), ':', msg) return for name in names: if name not in (os.curdir, os.pardir): @@ -140,10 +140,10 @@ def find(dir, pred, wq): try: stat = os.lstat(fullname) except os.error as msg: - print repr(fullname), ':', msg + print(repr(fullname), ':', msg) continue if pred(dir, name, fullname, stat): - print fullname + print(fullname) if S_ISDIR(stat[ST_MODE]): if not os.path.ismount(fullname): wq.addwork(find, (fullname, pred, wq)) |