VirtualMailManager/config.py
branchv0.6.x
changeset 481 90d69ae4f40d
parent 458 4ff0fa3ba0fa
child 496 17f2c5b5098e
--- a/VirtualMailManager/config.py	Sun Nov 13 19:59:26 2011 +0000
+++ b/VirtualMailManager/config.py	Sun Nov 13 20:18:41 2011 +0000
@@ -360,14 +360,12 @@
         Raises a ConfigError if the configuration syntax is
         invalid.
         """
+        self._cfg_file = open(self._cfg_filename, 'r')
         try:
-            self._cfg_file = open(self._cfg_filename, 'r')
             self.readfp(self._cfg_file)
         except (MissingSectionHeaderError, ParsingError), err:
             raise ConfigError(str(err), CONF_ERROR)
-        finally:
-            if self._cfg_file and not self._cfg_file.closed:
-                self._cfg_file.close()
+        self._cfg_file.close()
 
     def check(self):
         """Performs a configuration check.