# HG changeset patch # User Franz Glasner # Date 1624555373 -7200 # Node ID 9d729c479dc285937c8f7b8033cb11471e6e4249 # Parent 83f76a41cf7cd08b361669c9ec64dd3e0986e585 FIX: Do not apply the type convertion None -> "" if the expansions comprises the whole expression diff -r 83f76a41cf7c -r 9d729c479dc2 configmix/config.py --- a/configmix/config.py Thu Jun 24 09:33:22 2021 +0200 +++ b/configmix/config.py Thu Jun 24 19:22:53 2021 +0200 @@ -357,14 +357,14 @@ UserWarning, stacklevel=1) raise - if varvalue is None: - varvalue = u("") # - # Dont apply and type conversions to str if the whole `s` is - # just one expansion + # Dont apply and type conversions to the variable value if + # the whole `s` is just one expansion # if (start == 0) and (end + 2 == len(s)): return varvalue + if varvalue is None: + varvalue = u("") replaced = s[:start] + u(str(varvalue)) s = replaced + s[end+2:] # don't re-evaluate because `self.getvar_s()` expands already