# HG changeset patch # User Franz Glasner # Date 1641135935 -3600 # Node ID 4c968c5cfce6c68aedf9e733281c95729d696051 # Parent 79db28e879f8b700f7f528438de9b0879689be1b Try to interpolate only if the length of the source string exceeds a minimum length diff -r 79db28e879f8 -r 4c968c5cfce6 configmix/config.py --- a/configmix/config.py Sun Jan 02 02:04:07 2022 +0100 +++ b/configmix/config.py Sun Jan 02 16:05:35 2022 +0100 @@ -869,6 +869,9 @@ def interpolate_variables(self, s): """Expand all variables in the single string `s`""" + len_s = len(s) + if len_s < 4: + return s start = s.find(_STARTTOK, 0) if start < 0: return s @@ -883,7 +886,6 @@ "%r (cached)" % (s, )) else: return res - len_s = len(s) res = [] res_append = res.append rest = 0