common/migration.py
branch3.5
changeset 3152 7ef7c82daf59
parent 2897 2658f432284c
child 3230 1d25e928c299
--- a/common/migration.py	Wed Sep 09 17:57:46 2009 +0200
+++ b/common/migration.py	Wed Sep 09 17:58:09 2009 +0200
@@ -338,7 +338,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])
@@ -346,6 +346,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)