From: Fred Drake Date: Tue, 27 Aug 2002 16:34:54 +0000 (+0000) Subject: Don't use tempfile.mktemp(), since it produces annoying warnings, and X-Git-Tag: v2.3c1~4281 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=246beb25269bf0d2716f8b3cd474625dbae156d2;p=thirdparty%2FPython%2Fcpython.git Don't use tempfile.mktemp(), since it produces annoying warnings, and usually isn't what we want anyway. --- diff --git a/Doc/tools/mkhowto b/Doc/tools/mkhowto index af46fffbbcd5..322b6ba6b187 100755 --- a/Doc/tools/mkhowto +++ b/Doc/tools/mkhowto @@ -43,7 +43,6 @@ import re import shutil import string import sys -import tempfile if not hasattr(os.path, "abspath"): @@ -265,10 +264,12 @@ class Job: self.log_filename = os.path.abspath(self.doc + ".how") if os.path.exists(self.log_filename): os.unlink(self.log_filename) - if os.path.exists(self.doc + ".l2h"): - self.l2h_aux_init_file = tempfile.mktemp() - else: - self.l2h_aux_init_file = self.doc + ".l2h" + l2hconf = self.doc + ".l2h" + if os.path.exists(l2hconf): + if os.path.exists(l2hconf + "~"): + os.unlink(l2hconf + "~") + os.rename(l2hconf, l2hconf + "~") + self.l2h_aux_init_file = self.doc + ".l2h" self.write_l2h_aux_init_file() def build(self):