# HG changeset patch # User Franz Glasner # Date 1594071484 -7200 # Node ID 13283057a21e3b0b5a5efb3811c5c4b93f53a8b0 # Parent 6b5564e128a0fbc6d0ec2414140882fbafc7a8de Do not use ".format()" but string concatenation or (when conversion to Unicode is needed) the faster %s method diff -r 6b5564e128a0 -r 13283057a21e configmix/config.py --- a/configmix/config.py Thu May 21 09:57:18 2020 +0200 +++ b/configmix/config.py Mon Jul 06 23:38:04 2020 +0200 @@ -218,8 +218,8 @@ raise if varvalue is None: varvalue = u("") - replaced = u(b"{0}{1}").format(s[:start], varvalue) - s = u(b"{0}{1}").format(replaced, s[end+2:]) + replaced = u("%s%s") % (s[:start], varvalue) + s = replaced + s[end+2:] # don't re-evaluate because `self.getvar_s()` expands already start = s.find(self._STARTTOK, len(replaced)) return s