Skip to content

Commit 4757940

Browse files
committed
Remove unneeded unicode_convert method
Signed-off-by: Ivan Kanakarakis <[email protected]>
1 parent 2ae277e commit 4757940

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

src/saml2/config.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -266,20 +266,6 @@ def load_complex(self, cnf):
266266
raise ConfigurationError("No attribute converters, something is wrong!!")
267267
self.setattr("", "attribute_converters", acs)
268268

269-
def unicode_convert(self, item):
270-
try:
271-
return six.text_type(item, "utf-8")
272-
except TypeError:
273-
_uc = self.unicode_convert
274-
if isinstance(item, dict):
275-
return dict([(key, _uc(val)) for key, val in item.items()])
276-
elif isinstance(item, list):
277-
return [_uc(v) for v in item]
278-
elif isinstance(item, tuple):
279-
return tuple([_uc(v) for v in item])
280-
else:
281-
return item
282-
283269
def load(self, cnf, metadata_construction=False):
284270
""" The base load method, loads the configuration
285271
@@ -288,7 +274,7 @@ def load(self, cnf, metadata_construction=False):
288274
metadata. If so some things can be left out.
289275
:return: The Configuration instance
290276
"""
291-
_uc = self.unicode_convert
277+
292278
for arg in COMMON_ARGS:
293279
if arg == "virtual_organization":
294280
if "virtual_organization" in cnf:
@@ -303,7 +289,7 @@ def load(self, cnf, metadata_construction=False):
303289
self.extension_schema[_mod.NAMESPACE] = _mod
304290

305291
try:
306-
setattr(self, arg, _uc(cnf[arg]))
292+
setattr(self, arg, cnf[arg])
307293
except KeyError:
308294
pass
309295
except TypeError: # Something that can't be a string

0 commit comments

Comments
 (0)