common/migration.py
branchstable
changeset 3317 42ca81d2e805
parent 3316 c4c07aab1c39
child 3700 fd550e4dc515
--- a/common/migration.py	Fri Sep 18 11:24:37 2009 +0200
+++ b/common/migration.py	Fri Sep 18 12:21:49 2009 +0200
@@ -341,7 +341,7 @@
         configfile = self.config.main_config_file()
         if self._option_changes:
             read_old_config(self.config, self._option_changes, configfile)
-        _, newconfig = tempfile.mkstemp()
+        fd, newconfig = tempfile.mkstemp()
         for optdescr in self._option_changes:
             if optdescr[0] == 'added':
                 optdict = self.config.get_option_def(optdescr[1])
@@ -349,6 +349,7 @@
                     self.config.input_option(optdescr[1], optdict)
         self.config.generate_config(open(newconfig, 'w'))
         show_diffs(configfile, newconfig)
+        os.close(fd)
         if exists(newconfig):
             os.unlink(newconfig)