# HG changeset patch
# User Pascal Volk <user@localhost.localdomain.org>
# Date 1352244235 0
# Node ID 724ac0a4068df0fa025fe77469c4f8c8fb427ee4
# Parent  ebacd11563b08a0c2812231dec4a6fa03d686cd8
VMM/config: Undone changeset 90d69ae4f40d.

diff -r ebacd11563b0 -r 724ac0a4068d VirtualMailManager/config.py
--- a/VirtualMailManager/config.py	Tue Nov 06 21:45:50 2012 +0000
+++ b/VirtualMailManager/config.py	Tue Nov 06 23:23:55 2012 +0000
@@ -357,12 +357,14 @@
         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)
-        self._cfg_file.close()
+        finally:
+            if self._cfg_file and not self._cfg_file.closed:
+                self._cfg_file.close()
 
     def check(self):
         """Performs a configuration check.