summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-07-08 16:09:03 +0200
committerJürg Billeter <j@bitron.ch>2019-07-08 16:09:03 +0200
commitb1796680dd26c9a9eafdd6d4d73fd136a30a9f69 (patch)
treec2d1133ca4a89f1afd2d09eb9389f3d16ef3bf38
parentcf0516ba92fb4a220ae0086c411314cec4974df5 (diff)
downloadbuildstream-juerg/yaml-synthetic-file-index.tar.gz
_yaml.pyx: Fix file index checks for synthetic nodesjuerg/yaml-synthetic-file-index
Fixes #1051.
-rw-r--r--src/buildstream/_yaml.pyx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/buildstream/_yaml.pyx b/src/buildstream/_yaml.pyx
index 678374272..b1fee9be3 100644
--- a/src/buildstream/_yaml.pyx
+++ b/src/buildstream/_yaml.pyx
@@ -114,7 +114,7 @@ cdef class ProvenanceInformation:
cdef FileInfo fileinfo
self.node = nodeish
- if (nodeish is None) or (nodeish.file_index is None):
+ if (nodeish is None) or (nodeish.file_index == _SYNTHETIC_FILE_INDEX):
self.filename = ""
self.shortname = ""
self.displayname = ""
@@ -436,7 +436,7 @@ cpdef Node load_data(str data, int file_index=_SYNTHETIC_FILE_INDEX, str file_na
.format(type(contents[0]).__name__, file_name))
# Store this away because we'll use it later for "top level" provenance
- if file_index is not None:
+ if file_index != _SYNTHETIC_FILE_INDEX:
f_info = <FileInfo> _FILE_LIST[file_index]
_FILE_LIST[file_index] = FileInfo(