diff configmix/config.py @ 487:d7f6f2afcee2

Instead of using u(str(v)) use specialized functions for PY2 and PY3
author Franz Glasner <f.glasner@feldmann-mg.com>
date Fri, 17 Dec 2021 16:06:49 +0100
parents 008b35666a43
children 298510ec8171
line wrap: on
line diff
--- a/configmix/config.py	Fri Dec 17 15:56:53 2021 +0100
+++ b/configmix/config.py	Fri Dec 17 16:06:49 2021 +0100
@@ -28,7 +28,7 @@
     from urlparse import urlsplit
 
 from .variables import lookup_varns, lookup_filter
-from .compat import u, uchr, n, PY2
+from .compat import u, uchr, n, str_and_u, PY2
 from .constants import REF_NAMESPACE, NONE_FILTER, EMPTY_FILTER
 
 
@@ -699,7 +699,7 @@
                 # None and/or empty str are handled equally here
                 pass
             else:
-                res_append(u(str(varvalue)))
+                res_append(str_and_u(varvalue))
             # don't re-evaluate because `self.getvar_s()` expands already
             rest = end + 2
             start = s.find(self._STARTTOK, rest)