comparison configmix/config.py @ 510:acf1e8696d68

FIX: Some other lists that need to converted to tuples
author Franz Glasner <fzglas.hg@dom66.de>
date Sat, 18 Dec 2021 18:41:11 +0100
parents 4c2517e18af0
children 93a5346907ef
comparison
equal deleted inserted replaced
509:4c2517e18af0 510:acf1e8696d68
990 990
991 def getfirstvarl_s(self, *paths, **kwds): 991 def getfirstvarl_s(self, *paths, **kwds):
992 real_paths = [] 992 real_paths = []
993 for path in paths: 993 for path in paths:
994 if isinstance(path, (list, tuple)): 994 if isinstance(path, (list, tuple)):
995 real_paths.append(self._path + path) 995 real_paths.append(self._path + tuple(path))
996 elif isinstance(path, dict): 996 elif isinstance(path, dict):
997 raise TypeError( 997 raise TypeError(
998 "a `dict' is not supported in a jailed configuration") 998 "a `dict' is not supported in a jailed configuration")
999 else: 999 else:
1000 raise TypeError("a paths item must be a list or tuple") 1000 raise TypeError("a paths item must be a list or tuple")
1079 else: 1079 else:
1080 rootpath = tuple() 1080 rootpath = tuple()
1081 if self._path: 1081 if self._path:
1082 new_rootpath = self._path + tuple(rootpath) 1082 new_rootpath = self._path + tuple(rootpath)
1083 else: 1083 else:
1084 new_rootpath = rootpath 1084 new_rootpath = tuple(rootpath)
1085 sjc = _JailedConfiguration(*new_rootpath) 1085 sjc = _JailedConfiguration(*new_rootpath)
1086 if bind_root: 1086 if bind_root:
1087 sjc.rebind(self._base) 1087 sjc.rebind(self._base)
1088 return sjc 1088 return sjc
1089 1089