From 616216fefd6e208141e95564698e3716b275ca05 Mon Sep 17 00:00:00 2001 From: Huang Peng Date: Tue, 29 Jul 2008 19:23:27 +0800 Subject: [PATCH] Raise Exception when receive unsupport type. --- gconf/config.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gconf/config.py b/gconf/config.py index 935fc17..e204467 100644 --- a/gconf/config.py +++ b/gconf/config.py @@ -65,6 +65,7 @@ class Config(ibus.Object): return (self.__to_py_value(value.get_car()), self.__to_py_value(value.get_cdr())) if value.type == gconf.VALUE_LIST: return map(self.__to_py_value, value.get_list()) + raise ibus.IBusException("Do not support type == %s" % str(value.type)) def __to_gconf_value(self, value): if isinstance(value, str): @@ -94,6 +95,8 @@ class Config(ibus.Object): raise ibus.IBusException("Items of a list must be in same type") ret.set_list_type(_type) ret.set_list(value) + else: + raise ibus.IBusException("Do not support type of %s." % type(value)) return ret def __value_changed_cb(self, gconf, key, value): -- 2.7.4