summaryrefslogtreecommitdiffstats
path: root/Tools/scripts/fixcid.py
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-24 17:58:48 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-24 17:58:48 (GMT)
commit8b33dd8e547790af86e9fc85ea6c315ead276b6e (patch)
tree4da041d085b8c0226f691429036835167e3874ac /Tools/scripts/fixcid.py
parent6a7a49c6318afe8a54fe6dda2dd321af2a275295 (diff)
downloadcpython-8b33dd8e547790af86e9fc85ea6c315ead276b6e.zip
cpython-8b33dd8e547790af86e9fc85ea6c315ead276b6e.tar.gz
cpython-8b33dd8e547790af86e9fc85ea6c315ead276b6e.tar.bz2
Use OESeeror instead of os.error (#16720)
Patch by Serhiy Storchaka.
Diffstat (limited to 'Tools/scripts/fixcid.py')
-rwxr-xr-xTools/scripts/fixcid.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Tools/scripts/fixcid.py b/Tools/scripts/fixcid.py
index 87e2a09..1e4c428 100755
--- a/Tools/scripts/fixcid.py
+++ b/Tools/scripts/fixcid.py
@@ -97,7 +97,7 @@ def recursedown(dirname):
bad = 0
try:
names = os.listdir(dirname)
- except os.error as msg:
+ except OSError as msg:
err(dirname + ': cannot list directory: ' + str(msg) + '\n')
return 1
names.sort()
@@ -175,17 +175,17 @@ def fix(filename):
try:
statbuf = os.stat(filename)
os.chmod(tempname, statbuf[ST_MODE] & 0o7777)
- except os.error as msg:
+ except OSError as msg:
err(tempname + ': warning: chmod failed (' + str(msg) + ')\n')
# 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(filename + ': warning: backup failed (' + str(msg) + ')\n')
# Now move the temp file to the original file
try:
os.rename(tempname, filename)
- except os.error as msg:
+ except OSError as msg:
err(filename + ': rename failed (' + str(msg) + ')\n')
return 1
# Return success