summaryrefslogtreecommitdiffstats
path: root/Tools/idle/IOBinding.py
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/idle/IOBinding.py')
-rw-r--r--Tools/idle/IOBinding.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Tools/idle/IOBinding.py b/Tools/idle/IOBinding.py
index 0ea4524..d80e53c 100644
--- a/Tools/idle/IOBinding.py
+++ b/Tools/idle/IOBinding.py
@@ -280,9 +280,11 @@ class IOBinding:
if self.get_saved():
filename = self.filename
else:
- filename = tempfilename = tempfile.mktemp()
+ (tfd, tfn) = tempfile.mkstemp()
+ os.close(tfd)
+ filename = tfn
if not self.writefile(filename):
- os.unlink(tempfilename)
+ os.unlink(tfn)
return "break"
edconf = idleconf.getsection('EditorWindow')
command = edconf.get('print-command')