VMM/config: Undone changeset 90d69ae4f40d.
--- 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.