pyterm: fix exit behavior if twisted is not available

dev/timer
Hinnerk van Bruinehsen 9 years ago
parent 89a26b7331
commit 1b5836571b

@ -248,8 +248,12 @@ class SerCmd(cmd.Cmd):
# save history file
readline.write_history_file()
# shut down twisted if running
if reactor.running:
reactor.callFromThread(reactor.stop)
try:
if reactor.running:
reactor.callFromThread(reactor.stop)
except NameError:
pass
if self.tcp_serial:
self.ser.close()
return True

Loading…
Cancel
Save