Commit 2bdf9fe0 authored by Guillaume Seguin's avatar Guillaume Seguin

Call sys.exit() directly from do_exit() (#253)

parent 7ddd6400
...@@ -1287,10 +1287,10 @@ class pronsole(cmd.Cmd): ...@@ -1287,10 +1287,10 @@ class pronsole(cmd.Cmd):
print "Are you sure you want to exit while printing?" print "Are you sure you want to exit while printing?"
print "(this will terminate the print)." print "(this will terminate the print)."
if not self.confirm(): if not self.confirm():
return False return
self.log(_("Exiting program. Goodbye!")) self.log(_("Exiting program. Goodbye!"))
self.p.disconnect() self.p.disconnect()
return True sys.exit()
def help_exit(self): def help_exit(self):
self.log(_("Disconnects from the printer and exits the program.")) self.log(_("Disconnects from the printer and exits the program."))
...@@ -1474,9 +1474,7 @@ class pronsole(cmd.Cmd): ...@@ -1474,9 +1474,7 @@ class pronsole(cmd.Cmd):
line = raw_input(self.prompt) line = raw_input(self.prompt)
except EOFError: except EOFError:
print "" print ""
should_exit = self.do_exit("") self.do_exit("")
if should_exit:
exit()
except KeyboardInterrupt: except KeyboardInterrupt:
print "" print ""
line = "" line = ""
......
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