summaryrefslogtreecommitdiff
path: root/Tools/scripts/pathfix.py
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2013-04-12 23:30:59 +0300
committerAndrew Svetlov <andrew.svetlov@gmail.com>2013-04-12 23:30:59 +0300
commit3af33d6bf03bf0ec406533b9545323649ac1816c (patch)
treee328e82b300eb88b9cb166d6924cb39426d65952 /Tools/scripts/pathfix.py
parent5e6f04d06910f3605e5ae902df95a92f60c4254f (diff)
parent2197e54a100be8af98c2a104d6ce8fddbd59bfd5 (diff)
downloadcpython-3af33d6bf03bf0ec406533b9545323649ac1816c.tar.gz
Fix whitespaces
Diffstat (limited to 'Tools/scripts/pathfix.py')
-rwxr-xr-xTools/scripts/pathfix.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Tools/scripts/pathfix.py b/Tools/scripts/pathfix.py
index dd08e0aba3..ae1556162b 100755
--- a/Tools/scripts/pathfix.py
+++ b/Tools/scripts/pathfix.py
@@ -73,7 +73,7 @@ def recursedown(dirname):
bad = 0
try:
names = os.listdir(dirname)
- except os.error as msg:
+ except OSError as msg:
err('%s: cannot list directory: %r\n' % (dirname, msg))
return 1
names.sort()
@@ -131,24 +131,24 @@ def fix(filename):
mtime = statbuf.st_mtime
atime = statbuf.st_atime
os.chmod(tempname, statbuf[ST_MODE] & 0o7777)
- except os.error as msg:
+ except OSError as msg:
err('%s: warning: chmod failed (%r)\n' % (tempname, msg))
# Then make a backup of the original file as filename~
try:
os.rename(filename, filename + '~')
- except os.error as msg:
+ except OSError as msg:
err('%s: warning: backup failed (%r)\n' % (filename, msg))
# Now move the temp file to the original file
try:
os.rename(tempname, filename)
- except os.error as msg:
+ except OSError as msg:
err('%s: rename failed (%r)\n' % (filename, msg))
return 1
if preserve_timestamps:
if atime and mtime:
try:
os.utime(filename, (atime, mtime))
- except os.error as msg:
+ except OSError as msg:
err('%s: reset of timestamp failed (%r)\n' % (filename, msg))
return 1
# Return succes