summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Node/FS.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/SCons/Node/FS.py')
-rw-r--r--src/engine/SCons/Node/FS.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py
index 9da9d8e..3742f34 100644
--- a/src/engine/SCons/Node/FS.py
+++ b/src/engine/SCons/Node/FS.py
@@ -1601,9 +1601,12 @@ class Dir(Base):
if parent.exists():
break
listDirs.append(parent)
- parent = parent.up()
- else:
- raise SCons.Errors.StopError, parent.path
+ p = parent.up()
+ if p is None:
+ # Don't use while: - else: for this condition because
+ # if so, then parent is None and has no .path attribute.
+ raise SCons.Errors.StopError, parent.path
+ parent = p
listDirs.reverse()
for dirnode in listDirs:
try: