1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

pyterm: fix exit behavior if twisted is not available

This commit is contained in:
Hinnerk van Bruinehsen 2014-08-16 00:49:43 +02:00
parent 89a26b7331
commit 1b5836571b

View File

@ -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