VMM/Config: LazyConfigOption.__init__() cast 'default' to 'cls'.
If the default value is not None, make sure it has the proper type.
--- a/VirtualMailManager/Config.py Thu Feb 11 07:20:49 2010 +0000
+++ b/VirtualMailManager/Config.py Fri Feb 12 04:15:18 2010 +0000
@@ -247,7 +247,10 @@
the value, when `LazyConfig.set()` is called.
"""
self.__cls = cls
- self.__default = default
+ if not default is None:# enforce the type of the default value
+ self.__default = self.__cls(default)
+ else:
+ self.__default = default
if not callable(getter):
raise TypeError('getter has to be a callable, got a %r' %
getter.__class__.__name__)