diff options
author | William Deegan <bill@baddogconsulting.com> | 2017-05-16 17:34:10 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2017-05-16 17:34:10 (GMT) |
commit | 023b20eeeb87114afa2edcef6ea7af11ee51fe8d (patch) | |
tree | a2c40b3094ff11fc635dca126ede5e086adafbed /src/engine/SCons | |
parent | 3fb6172cb70be932f03296842ee434fc44eabe56 (diff) | |
download | SCons-023b20eeeb87114afa2edcef6ea7af11ee51fe8d.zip SCons-023b20eeeb87114afa2edcef6ea7af11ee51fe8d.tar.gz SCons-023b20eeeb87114afa2edcef6ea7af11ee51fe8d.tar.bz2 |
PY2/3 fix error message strings for py3 on win32
Diffstat (limited to 'src/engine/SCons')
-rw-r--r-- | src/engine/SCons/Platform/win32.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/engine/SCons/Platform/win32.py b/src/engine/SCons/Platform/win32.py index c6887f1..a735899 100644 --- a/src/engine/SCons/Platform/win32.py +++ b/src/engine/SCons/Platform/win32.py @@ -77,7 +77,7 @@ else: def __init__(self, *args, **kw): _builtin_file.__init__(self, *args, **kw) win32api.SetHandleInformation(msvcrt.get_osfhandle(self.fileno()), - win32con.HANDLE_FLAG_INHERIT, 0) + win32con.HANDLE_FLAG_INHERIT, 0) file = _scons_file else: import io @@ -226,10 +226,10 @@ def piped_spawn(sh, escape, cmd, args, env, stdout, stderr): def exec_spawn(l, env): try: result = spawnve(os.P_WAIT, l[0], l, env) - except OSError as e: + except (OSError, EnvironmentError) as e: try: - result = exitvalmap[e[0]] - sys.stderr.write("scons: %s: %s\n" % (l[0], e[1])) + result = exitvalmap[e.errno] + sys.stderr.write("scons: %s: %s\n" % (l[0], e.strerror)) except KeyError: result = 127 if len(l) > 2: @@ -239,7 +239,7 @@ def exec_spawn(l, env): command = l[0] else: command = l[0] - sys.stderr.write("scons: unknown OSError exception code %d - '%s': %s\n" % (e[0], command, e[1])) + sys.stderr.write("scons: unknown OSError exception code %d - '%s': %s\n" % (e.errno, command, e.strerror)) return result |