From 596f9fa6bed4777348f005fb98f8b67dda93b515 Mon Sep 17 00:00:00 2001 From: Steven Knight Date: Sun, 8 Sep 2002 04:13:20 +0000 Subject: Eliminate an exception when using -U. --- src/CHANGES.txt | 3 +++ src/engine/SCons/Node/FS.py | 1 + src/engine/SCons/Node/FSTests.py | 1 + test/option--U.py | 10 ++++++++++ 4 files changed, 15 insertions(+) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 1a00b43..ea65a0a 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -32,6 +32,9 @@ RELEASE 0.09 - - Fix the ASPPCOM values for the GNU assembler. (Bug reported by Brett Polivka.) + - Fix an exception thrown when a Default() directory was specified + when using the -U option. + From Anthony Roach: - Fixed use of command lines with spaces in their arguments, diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 96381e3..c4b220f 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -496,6 +496,7 @@ class Dir(Entry): self.entries = {} self.entries['.'] = self self.entries['..'] = self.dir + self.cwd = self self.builder = 1 self._sconsign = None diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py index 3bba3f4..f87abe7 100644 --- a/src/engine/SCons/Node/FSTests.py +++ b/src/engine/SCons/Node/FSTests.py @@ -203,6 +203,7 @@ class FSTestCase(unittest.TestCase): fs = SCons.Node.FS.FS() d1 = fs.Dir('d1') + assert d1.cwd is d1, d1 f1 = fs.File('f1', directory = d1) diff --git a/test/option--U.py b/test/option--U.py index d2c518d..23e82b1 100644 --- a/test/option--U.py +++ b/test/option--U.py @@ -134,4 +134,14 @@ test.fail_test(os.path.exists(test.workpath('bar.out'))) test.fail_test(os.path.exists(test.workpath('sub2/xxx.out'))) +# Make sure that a Default() directory doesn't cause an exception. +test.subdir('sub4') + +test.write(['sub4', 'SConstruct'], """ +Default('.') +""") + +test.run(chdir = 'sub4', arguments = '-U') + + test.pass_test() -- cgit v0.12