catch KeyboardInterrupt
This commit is contained in:
@@ -10,5 +10,5 @@ try:
|
||||
binstring = string.encode('UTF-8')
|
||||
while True:
|
||||
channel.basic_publish(exchange="test",routing_key="test",body=binstring)
|
||||
except Exception:
|
||||
except KeyboardInterrupt:
|
||||
connection.close()
|
||||
|
||||
Reference in New Issue
Block a user