Commit 9067c8d8 authored by Kurt B. Kaiser's avatar Kurt B. Kaiser

SF 748975 Printing unsaved shell fails

M IOBinding.py
parent 2f3c74a5
...@@ -459,9 +459,12 @@ class IOBinding: ...@@ -459,9 +459,12 @@ class IOBinding:
def print_window(self, event): def print_window(self, event):
tempfilename = None tempfilename = None
if self.get_saved(): saved = self.get_saved()
if saved:
filename = self.filename filename = self.filename
else: # shell undo is reset after every prompt, looks saved, probably isn't
if not saved or filename is None:
# XXX KBK 08Jun03 Wouldn't it be better to ask the user to save?
filename = tempfilename = tempfile.mktemp() filename = tempfilename = tempfile.mktemp()
if not self.writefile(filename): if not self.writefile(filename):
os.unlink(tempfilename) os.unlink(tempfilename)
...@@ -479,6 +482,7 @@ class IOBinding: ...@@ -479,6 +482,7 @@ class IOBinding:
if printPlatform: #we can try to print for this platform if printPlatform: #we can try to print for this platform
command = command % filename command = command % filename
pipe = os.popen(command, "r") pipe = os.popen(command, "r")
# things can get ugly on NT if there is no printer available.
output = pipe.read().strip() output = pipe.read().strip()
status = pipe.close() status = pipe.close()
if status: if status:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment