diff options
author | Steven Knight <knight@baldmt.com> | 2003-11-09 04:16:29 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-11-09 04:16:29 (GMT) |
commit | 1a7987cd3b3d741ed45066b170c3c6ac8d2cefcd (patch) | |
tree | 87235f156582c560b8c9d2b3481572e50f7d5a50 /src/engine/SCons | |
parent | 63533d07bd079c258b8ce82f97266dc5844a5edf (diff) | |
download | SCons-1a7987cd3b3d741ed45066b170c3c6ac8d2cefcd.zip SCons-1a7987cd3b3d741ed45066b170c3c6ac8d2cefcd.tar.gz SCons-1a7987cd3b3d741ed45066b170c3c6ac8d2cefcd.tar.bz2 |
Fix specifying a root directory with just the drive string (e.g. C:).
Diffstat (limited to 'src/engine/SCons')
-rw-r--r-- | src/engine/SCons/Node/FS.py | 3 | ||||
-rw-r--r-- | src/engine/SCons/Node/FSTests.py | 11 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index bce5364..e7ab14a 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -646,6 +646,9 @@ class FS: path_comp = path_comp[1:] else: path_comp = [ path_first, ] + path_comp[1:] + + if not path_comp: + path_comp = [''] # Lookup the directory for path_name in path_comp[:-1]: diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py index 54c6523..cbda758 100644 --- a/src/engine/SCons/Node/FSTests.py +++ b/src/engine/SCons/Node/FSTests.py @@ -673,6 +673,17 @@ class FSTestCase(unittest.TestCase): except: raise + # Test that just specifying the drive works to identify + # its root directory. + p = os.path.abspath(test.workpath('root_file')) + drive, path = os.path.splitdrive(p) + if drive: + # The assert below probably isn't correct for the + # general case, but it works for Win32, which covers a + # lot of ground... + dir = fs.Dir(drive) + assert str(dir) == drive + os.sep, str(dir) + # Test Dir.children() dir = fs.Dir('ddd') fs.File(string.join(['ddd', 'f1'], sep)) |