diff options
author | Steven Knight <knight@baldmt.com> | 2002-01-31 21:44:11 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2002-01-31 21:44:11 (GMT) |
commit | e4055f33a18a5a462150a061b2b4009db0867c8c (patch) | |
tree | 9184f7c21f18869b6be20a420119e76c1219851b /src/engine/SCons/Node/FS.py | |
parent | 17d45b75a38380cb04553a82cba8eb034deb97cd (diff) | |
download | SCons-e4055f33a18a5a462150a061b2b4009db0867c8c.zip SCons-e4055f33a18a5a462150a061b2b4009db0867c8c.tar.gz SCons-e4055f33a18a5a462150a061b2b4009db0867c8c.tar.bz2 |
Compensate for an os.path.normpath('./') bug on Win32. (Charles Crain)
Diffstat (limited to 'src/engine/SCons/Node/FS.py')
-rw-r--r-- | src/engine/SCons/Node/FS.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index f07d51d..5508436 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -136,6 +136,18 @@ class FS: relative path with directory=None, then an AssertionError will be raised.""" + if not name: + # This is a stupid hack to compensate for the fact + # that the POSIX and Win32 versions of os.path.normpath() + # behave differently. In particular, in POSIX: + # os.path.normpath('./') == '.' + # in Win32 + # os.path.normpath('./') == '' + # os.path.normpath('.\\') == '' + # + # This is a definite bug in the Python library, but we have + # to live with it. + name = '.' path_comp = string.split(name, os.sep) drive, path_first = os.path.splitdrive(path_comp[0]) if not path_first: |