nodes: fix bug in Node() fspath compat
Since path <-> fspath are converted to each other, we need to check both before looking at the parent, in case fspath is set but path is not.
This commit is contained in:
parent
f695e18ddb
commit
853b0a4c29
|
@ -210,9 +210,9 @@ class Node(metaclass=NodeMeta):
|
|||
self.session = parent.session
|
||||
|
||||
#: Filesystem path where this node was collected from (can be None).
|
||||
self.path = _imply_path_only(
|
||||
path or getattr(parent, "path", None), fspath=fspath
|
||||
)
|
||||
if path is None and fspath is None:
|
||||
path = getattr(parent, "path", None)
|
||||
self.path = _imply_path_only(path, fspath=fspath)
|
||||
|
||||
# The explicit annotation is to avoid publicly exposing NodeKeywords.
|
||||
#: Keywords/markers collected from all scopes.
|
||||
|
|
Loading…
Reference in New Issue