mirror of
https://github.com/romanz/amodem.git
synced 2026-02-24 16:18:12 +08:00
gpg: allow graceful exit via Ctrl+C
This commit is contained in:
@@ -14,7 +14,10 @@ def yield_connections(sock):
|
||||
"""Run a server on the specified socket."""
|
||||
while True:
|
||||
log.debug('waiting for connection on %s', sock.getsockname())
|
||||
conn, _ = sock.accept()
|
||||
try:
|
||||
conn, _ = sock.accept()
|
||||
except KeyboardInterrupt:
|
||||
return
|
||||
conn.settimeout(None)
|
||||
log.debug('accepted connection on %s', sock.getsockname())
|
||||
yield conn
|
||||
|
||||
Reference in New Issue
Block a user