diff options
author | Adam Gross <grossag@vmware.com> | 2020-04-02 13:58:16 (GMT) |
---|---|---|
committer | Adam Gross <grossag@vmware.com> | 2020-04-02 13:58:16 (GMT) |
commit | 7a06a452f268c81fd3f509ad46025214ad586d29 (patch) | |
tree | a26ca346a01e45ebfb7f3e4f36f45a7f1bf15eef /src | |
parent | 8686ba9c3b577f14b8d072ebf0d2f22b53ce9fbb (diff) | |
download | SCons-7a06a452f268c81fd3f509ad46025214ad586d29.zip SCons-7a06a452f268c81fd3f509ad46025214ad586d29.tar.gz SCons-7a06a452f268c81fd3f509ad46025214ad586d29.tar.bz2 |
Fix inconsistencies between RootDir attributes
The RootDir class was returning different values for path and _path as well as
different values for abspath and _abspath. This is because the underscored
versions were being set in the RootDir constructor, while the non-underscored
versions were going through the EntryProxy wrapper, which is only coded to do
a simple append of paths.
I considered trying to fix EntryProxy to detect this case but instead went with
a simpler approach where RootDir overrides the attributes that it wants to
avoid EntryProxy calls. Right now I have this as path and abspath.
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/SCons/Node/FS.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index bb965db..b7f6abe 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -2246,7 +2246,7 @@ class RootDir(Dir): this directory. """ - __slots__ = ('_lookupDict', ) + __slots__ = ('_lookupDict', 'abspath', 'path') def __init__(self, drive, fs): if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.RootDir') @@ -2288,6 +2288,12 @@ class RootDir(Dir): self._tpath = dirname self.dirname = dirname + # EntryProxy interferes with this class and turns drive paths on + # Windows such as "C:" into "C:\C:". Avoid this problem by setting + # commonly-accessed attributes directly. + self.abspath = self._abspath + self.path = self._path + self._morph() self.duplicate = 0 |