diff options
| author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-24 19:58:48 +0200 | 
|---|---|---|
| committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-24 19:58:48 +0200 | 
| commit | 8b33dd8e547790af86e9fc85ea6c315ead276b6e (patch) | |
| tree | 4da041d085b8c0226f691429036835167e3874ac /Tools/scripts/pathfix.py | |
| parent | 6a7a49c6318afe8a54fe6dda2dd321af2a275295 (diff) | |
| download | cpython-git-8b33dd8e547790af86e9fc85ea6c315ead276b6e.tar.gz | |
Use OESeeror instead of os.error (#16720)
Patch by Serhiy Storchaka.
Diffstat (limited to 'Tools/scripts/pathfix.py')
| -rwxr-xr-x | Tools/scripts/pathfix.py | 10 | 
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 | 
