summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2016-05-12 20:41:15 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2016-05-12 20:41:15 (GMT)
commitfdd25f581023b3a4a98a4682ee20c64fb7567f90 (patch)
treebb3cde8d5aa8ad5a2c287b6c4aac3f528ebbc8b5
parent5dc3cdfd4df03ca7aa4d7db058e2c0b3926d4c10 (diff)
downloadSCons-fdd25f581023b3a4a98a4682ee20c64fb7567f90.zip
SCons-fdd25f581023b3a4a98a4682ee20c64fb7567f90.tar.gz
SCons-fdd25f581023b3a4a98a4682ee20c64fb7567f90.tar.bz2
fix error where IOError and OSError exceptions were falling through to the wrong case in Errors.py/convert_to_BuildError().. EnvironmentError is now just an alias in Py3 and it looks like the future module is not properly handling the py3 alias'ing and breaking the py2 exception class hierarchy.
-rw-r--r--src/engine/SCons/Errors.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/engine/SCons/Errors.py b/src/engine/SCons/Errors.py
index 54e888c..3cc9c6d 100644
--- a/src/engine/SCons/Errors.py
+++ b/src/engine/SCons/Errors.py
@@ -144,6 +144,7 @@ def convert_to_BuildError(status, exc_info=None):
if not exc_info and isinstance(status, Exception):
exc_info = (status.__class__, status, None)
+
if isinstance(status, BuildError):
buildError = status
buildError.exitstatus = 2 # always exit with 2 on build errors
@@ -161,14 +162,17 @@ def convert_to_BuildError(status, exc_info=None):
status=2,
exitstatus=2,
exc_info=exc_info)
- elif isinstance(status, EnvironmentError):
+ elif isinstance(status, (EnvironmentError, OSError, IOError)):
# If an IOError/OSError happens, raise a BuildError.
# Report the name of the file or directory that caused the
# error, which might be different from the target being built
# (for example, failure to create the directory in which the
# target file will appear).
- try: filename = status.filename
- except AttributeError: filename = None
+ try:
+ filename = status.filename
+ except AttributeError:
+ filename = None
+
buildError = BuildError(
errstr=status.strerror,
status=status.errno,