Mercurial > hgrepos > Python > libs > ConfigMix
changeset 248:13283057a21e
Do not use ".format()" but string concatenation or (when conversion to Unicode is needed) the faster %s method
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 06 Jul 2020 23:38:04 +0200 |
| parents | 6b5564e128a0 |
| children | 1e38ccfba3de |
| files | configmix/config.py |
| diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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
