[Python-checkins] cpython: Cleanup filecmp: starting from 3.3 os.error is alias for OSError

andrew.svetlov python-checkins at python.org
Fri Dec 14 17:02:39 CET 2012


http://hg.python.org/cpython/rev/091e68e08c3c
changeset:   80843:091e68e08c3c
user:        Andrew Svetlov <andrew.svetlov at gmail.com>
date:        Fri Dec 14 18:02:27 2012 +0200
summary:
  Cleanup filecmp: starting from 3.3 os.error is alias for OSError

files:
  Lib/filecmp.py |  6 +++---
  1 files changed, 3 insertions(+), 3 deletions(-)


diff --git a/Lib/filecmp.py b/Lib/filecmp.py
--- a/Lib/filecmp.py
+++ b/Lib/filecmp.py
@@ -147,12 +147,12 @@
             ok = 1
             try:
                 a_stat = os.stat(a_path)
-            except os.error as why:
+            except OSError as why:
                 # print('Can\'t stat', a_path, ':', why.args[1])
                 ok = 0
             try:
                 b_stat = os.stat(b_path)
-            except os.error as why:
+            except OSError as why:
                 # print('Can\'t stat', b_path, ':', why.args[1])
                 ok = 0
 
@@ -268,7 +268,7 @@
 def _cmp(a, b, sh, abs=abs, cmp=cmp):
     try:
         return not abs(cmp(a, b, sh))
-    except os.error:
+    except OSError:
         return 2
 
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list