We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 667e418 commit 963f13fCopy full SHA for 963f13f
src/websockets/__main__.py
@@ -12,6 +12,7 @@
12
except ImportError: # Windows has no `readline` normally
13
pass
14
15
+from .frames import Close
16
from .sync.client import ClientConnection, connect
17
from .version import version as websockets_version
18
@@ -150,7 +151,10 @@ def main() -> None:
150
151
except (KeyboardInterrupt, EOFError): # ^C, ^D
152
stop.set()
153
websocket.close()
- print_over_input("Connection closed.")
154
+
155
+ assert websocket.close_code is not None and websocket.close_reason is not None
156
+ close_status = Close(websocket.close_code, websocket.close_reason)
157
+ print_over_input(f"Connection closed: {close_status}.")
158
159
thread.join()
160
0 commit comments