From 12c88e124b898d41e7b4902af5b8da38ce11164b Mon Sep 17 00:00:00 2001 From: stevenknight Date: Wed, 30 Apr 2003 02:15:28 +0000 Subject: [PATCH] Fix the spawn() functions. (Anthony Roach) git-svn-id: http://scons.tigris.org/svn/scons/trunk@664 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/CHANGES.txt | 2 ++ src/engine/SCons/Action.py | 5 ----- src/engine/SCons/Platform/posix.py | 5 +++++ src/engine/SCons/Platform/win32.py | 1 + test/builderrors.py | 15 +++++++++++++++ 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index c088d58f..04afab8f 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -88,6 +88,8 @@ RELEASE 0.14 - XXX - Support Import('*') to import everything that's been Export()ed. + - Fix an undefined exitvalmap on Win32 systems. + From David Snopek: - Contribute the "Autoscons" code for Autoconf-like checking for diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py index 764d5279..12608504 100644 --- a/src/engine/SCons/Action.py +++ b/src/engine/SCons/Action.py @@ -45,11 +45,6 @@ _null = _Null print_actions = 1; execute_actions = 1; -exitvalmap = { - 2 : 127, - 13 : 126, -} - default_ENV = None def rfile(n): diff --git a/src/engine/SCons/Platform/posix.py b/src/engine/SCons/Platform/posix.py index fd78de49..03c86984 100644 --- a/src/engine/SCons/Platform/posix.py +++ b/src/engine/SCons/Platform/posix.py @@ -40,6 +40,11 @@ import sys import SCons.Util +exitvalmap = { + 2 : 127, + 13 : 126, +} + def escape(arg): "escape shell special characters" slash = '\\' diff --git a/src/engine/SCons/Platform/win32.py b/src/engine/SCons/Platform/win32.py index 4f7b05bd..39c0ba8b 100644 --- a/src/engine/SCons/Platform/win32.py +++ b/src/engine/SCons/Platform/win32.py @@ -37,6 +37,7 @@ import os.path import string import sys import tempfile +from SCons.Platform.posix import exitvalmap import SCons.Util diff --git a/test/builderrors.py b/test/builderrors.py index 568ed0d7..4eb6bfad 100644 --- a/test/builderrors.py +++ b/test/builderrors.py @@ -25,6 +25,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os +import string import sys import TestSCons @@ -105,4 +106,18 @@ test.fail_test(test.read(['three', 'f1.out']) != "three/f1.in\n") test.fail_test(test.read(['three', 'f2.out']) != "three/f2.in\n") test.fail_test(os.path.exists(test.workpath('f3.out'))) +test.write('SConstruct', """ +env=Environment() +if env['PLATFORM'] == 'posix': + from SCons.Platform.posix import fork_spawn + env['SPAWN'] = fork_spawn +env['ENV']['PATH'] = '' +env.Command(target='foo.out', source=[], action='not_a_program') +""") + +test.run(status=2, stderr=None) +err = test.stderr() +test.fail_test(string.find(err, 'Exception') != -1 or \ + string.find(err, 'Traceback') != -1) + test.pass_test() -- 2.26.2