VirtualMailManager/Config.py
branchv0.6.x
changeset 175 b241272eb1bd
parent 174 974bafa59330
child 178 9480f2b15129
--- a/VirtualMailManager/Config.py	Sun Jan 24 06:40:38 2010 +0000
+++ b/VirtualMailManager/Config.py	Sun Jan 24 09:06:05 2010 +0000
@@ -332,9 +332,10 @@
             self.__cfgFile = open(self.__cfgFileName, 'r')
             self.readfp(self.__cfgFile)
         except (MissingSectionHeaderError, ParsingError), e:
-            self.__cfgFile.close()
             raise VMMConfigException(str(e), ERR.CONF_ERROR)
-        self.__cfgFile.close()
+        finally:
+            if not self.__cfgFile is None and not self.__cfgFile.closed:
+                self.__cfgFile.close()
 
     def check(self):
         """Performs a configuration check.