From 2137156caf913fdc50c5492a5d448601674aa7ed Mon Sep 17 00:00:00 2001 From: stevenknight Date: Wed, 28 Aug 2002 16:01:52 +0000 Subject: [PATCH] On Win32 systems, supply a default if PATHEXT isn't in the environment; it doesn't exist on Win95/Win98. git-svn-id: http://scons.tigris.org/svn/scons/trunk@450 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/engine/SCons/Util.py | 5 ++++- test/Repository/StaticLibrary.py | 4 ++-- test/Repository/link-object.py | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py index 51789566..63c992e3 100644 --- a/src/engine/SCons/Util.py +++ b/src/engine/SCons/Util.py @@ -433,7 +433,10 @@ if sys.platform == 'win32': if is_String(path): path = string.split(path, os.pathsep) if pathext is None: - pathext = os.environ['PATHEXT'] + try: + pathext = os.environ['PATHEXT'] + except KeyError: + pathext = '.COM;.EXE;.BAT;.CMD' if is_String(pathext): pathext = string.split(pathext, os.pathsep) for ext in pathext: diff --git a/test/Repository/StaticLibrary.py b/test/Repository/StaticLibrary.py index 3861ce9d..14b9c3ba 100644 --- a/test/Repository/StaticLibrary.py +++ b/test/Repository/StaticLibrary.py @@ -115,7 +115,7 @@ test.fail_test(os.path.exists(repository_foo)) test.up_to_date(chdir = 'work1', options = opts, arguments = ".") -test.write(['work1', 'bbb.c'], """ +test.write(['work1', 'bbb.c'], r""" void bbb(void) { @@ -161,7 +161,7 @@ test.writable('repository', 0) # test.up_to_date(chdir = 'work2', options = opts, arguments = ".") -test.write(['work2', 'bbb.c'], """ +test.write(['work2', 'bbb.c'], r""" void bbb(void) { diff --git a/test/Repository/link-object.py b/test/Repository/link-object.py index af0214e5..90d2e70e 100644 --- a/test/Repository/link-object.py +++ b/test/Repository/link-object.py @@ -106,7 +106,7 @@ env.Program(target = 'foo', source = ['aaa.c', 'bbb.c', 'foo.c']) test.up_to_date(chdir = 'work', arguments = ".") # -test.write(['work', 'bbb.c'], """ +test.write(['work', 'bbb.c'], r""" void bbb(void) { -- 2.26.2