# HG changeset patch
# User Pascal Volk <neverseen@users.sourceforge.net>
# Date 1265948118 0
# Node ID dbb0f7ed7858f84f1e45d7e57410d1443761fc86
# Parent  983cf98d588110c90d86194dfb143f43e7b46e38
VMM/Config: LazyConfigOption.__init__() cast 'default' to 'cls'.
If the default value is not None, make sure it has the proper type.

diff -r 983cf98d5881 -r dbb0f7ed7858 VirtualMailManager/Config.py
--- 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__)