From 770d4cda430803f8e020c57971c4dd8e802dc417 Mon Sep 17 00:00:00 2001 From: Tomas Krizek Date: Mon, 27 Feb 2017 13:08:36 +0100 Subject: Env __setitem__: replace assert with exception Use exception to make debugging issues easier. Reviewed-By: Christian Heimes --- ipalib/config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ipalib/config.py b/ipalib/config.py index 4891f53d7..45052ad5b 100644 --- a/ipalib/config.py +++ b/ipalib/config.py @@ -268,7 +268,8 @@ class Env(object): value = int(value) elif key == 'basedn': value = DN(value) - assert type(value) in (unicode, int, float, bool, type(None), DN) + if type(value) not in (unicode, int, float, bool, type(None), DN): + raise TypeError(key, value) object.__setattr__(self, key, value) self.__d[key] = value -- cgit