diff options
Diffstat (limited to 'src/buildstream/_variables.pyx')
-rw-r--r-- | src/buildstream/_variables.pyx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/buildstream/_variables.pyx b/src/buildstream/_variables.pyx index 0e3bdb29c..d12938dd9 100644 --- a/src/buildstream/_variables.pyx +++ b/src/buildstream/_variables.pyx @@ -172,11 +172,15 @@ cdef class Variables: # LoadError, if the string contains unresolved variable references or # if cycles are detected in the variable references # - def _flatten(self): - flat = {} + cdef dict _flatten(self): + cdef dict flat = {} + cdef str key + cdef list expstr + try: for key, expstr in self._expstr_map.items(): if len(expstr) > 1: + # FIXME: do we really gain anything by interning? expstr = [sys.intern(_expand_expstr(self._expstr_map, expstr))] self._expstr_map[key] = expstr flat[key] = expstr[0] |