diff options
author | Tomas Krizek <tkrizek@redhat.com> | 2017-02-27 13:08:36 +0100 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2017-03-01 12:59:21 +0100 |
commit | 770d4cda430803f8e020c57971c4dd8e802dc417 (patch) | |
tree | 78e93ad330af04d573863d6017c1230a0c7e882d | |
parent | 135d0b5dd111d40632e2cd5be8f5315684b45fc6 (diff) | |
download | freeipa-770d4cda430803f8e020c57971c4dd8e802dc417.tar.gz freeipa-770d4cda430803f8e020c57971c4dd8e802dc417.tar.xz freeipa-770d4cda430803f8e020c57971c4dd8e802dc417.zip |
Env __setitem__: replace assert with exception
Use exception to make debugging issues easier.
Reviewed-By: Christian Heimes <cheimes@redhat.com>
-rw-r--r-- | ipalib/config.py | 3 |
1 files changed, 2 insertions, 1 deletions
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 |