summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--command/build_scripts.py2
-rw-r--r--core.py2
-rw-r--r--cygwinccompiler.py2
-rw-r--r--dir_util.py2
-rw-r--r--errors.py4
-rw-r--r--msvc9compiler.py2
-rw-r--r--sysconfig.py4
-rw-r--r--util.py4
8 files changed, 11 insertions, 11 deletions
diff --git a/command/build_scripts.py b/command/build_scripts.py
index 4b5b22ec..90a8380a 100644
--- a/command/build_scripts.py
+++ b/command/build_scripts.py
@@ -74,7 +74,7 @@ class build_scripts(Command):
# script.
try:
f = open(script, "rb")
- except IOError:
+ except OSError:
if not self.dry_run:
raise
f = None
diff --git a/core.py b/core.py
index a43d7258..91e51329 100644
--- a/core.py
+++ b/core.py
@@ -148,7 +148,7 @@ def setup (**attrs):
dist.run_commands()
except KeyboardInterrupt:
raise SystemExit("interrupted")
- except (IOError, OSError) as exc:
+ except OSError as exc:
error = grok_environment_error(exc)
if DEBUG:
diff --git a/cygwinccompiler.py b/cygwinccompiler.py
index 0bdd539c..0c23ab1b 100644
--- a/cygwinccompiler.py
+++ b/cygwinccompiler.py
@@ -359,7 +359,7 @@ def check_config_h():
return CONFIG_H_NOTOK, "'%s' does not mention '__GNUC__'" % fn
finally:
config_h.close()
- except IOError as exc:
+ except OSError as exc:
return (CONFIG_H_UNCERTAIN,
"couldn't read '%s': %s" % (fn, exc.strerror))
diff --git a/dir_util.py b/dir_util.py
index 7d1c78ab..2b35aa31 100644
--- a/dir_util.py
+++ b/dir_util.py
@@ -198,7 +198,7 @@ def remove_tree(directory, verbose=1, dry_run=0):
abspath = os.path.abspath(cmd[1])
if abspath in _path_created:
del _path_created[abspath]
- except (IOError, OSError) as exc:
+ except OSError as exc:
log.warn(grok_environment_error(
exc, "error removing %s: " % directory))
diff --git a/errors.py b/errors.py
index eb13c983..8b93059e 100644
--- a/errors.py
+++ b/errors.py
@@ -35,8 +35,8 @@ class DistutilsArgError (DistutilsError):
class DistutilsFileError (DistutilsError):
"""Any problems in the filesystem: expected file not found, etc.
- Typically this is for problems that we detect before IOError or
- OSError could be raised."""
+ Typically this is for problems that we detect before OSError
+ could be raised."""
pass
class DistutilsOptionError (DistutilsError):
diff --git a/msvc9compiler.py b/msvc9compiler.py
index b3f6ce10..9688f200 100644
--- a/msvc9compiler.py
+++ b/msvc9compiler.py
@@ -729,7 +729,7 @@ class MSVCCompiler(CCompiler) :
return manifest_file
finally:
manifest_f.close()
- except IOError:
+ except OSError:
pass
# -- Miscellaneous methods -----------------------------------------
diff --git a/sysconfig.py b/sysconfig.py
index 3b6549fc..91ed1a49 100644
--- a/sysconfig.py
+++ b/sysconfig.py
@@ -426,7 +426,7 @@ def _init_posix():
try:
filename = get_makefile_filename()
parse_makefile(filename, g)
- except IOError as msg:
+ except OSError as msg:
my_msg = "invalid Python installation: unable to open %s" % filename
if hasattr(msg, "strerror"):
my_msg = my_msg + " (%s)" % msg.strerror
@@ -438,7 +438,7 @@ def _init_posix():
filename = get_config_h_filename()
with open(filename) as file:
parse_config_h(file, g)
- except IOError as msg:
+ except OSError as msg:
my_msg = "invalid Python installation: unable to open %s" % filename
if hasattr(msg, "strerror"):
my_msg = my_msg + " (%s)" % msg.strerror
diff --git a/util.py b/util.py
index ba09ac45..a2f95445 100644
--- a/util.py
+++ b/util.py
@@ -207,8 +207,8 @@ def subst_vars (s, local_vars):
def grok_environment_error (exc, prefix="error: "):
- """Generate a useful error message from an EnvironmentError (IOError or
- OSError) exception object. Handles Python 1.5.1 and 1.5.2 styles, and
+ """Generate a useful error message from an OSError
+ exception object. Handles Python 1.5.1 and 1.5.2 styles, and
does what it can to deal with exception objects that don't have a
filename (which happens when the error is due to a two-file operation,
such as 'rename()' or 'link()'. Returns the error message as a string