Skip to content

Commit b5d1ffb

Browse files
committed
REPL: use quit() instead of exit() to exit
1 parent e9f7879 commit b5d1ffb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

unpythonic/net/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ def sock_to_stdout():
123123
print("replclient: Ctrl+D pressed, asking server to disconnect.")
124124
print("replclient: if the server does not respond, press Ctrl+C to force.")
125125
try:
126-
print("exit()") # local echo
127-
sock.sendall("exit()\n".encode("utf-8"))
126+
print("quit()") # local echo
127+
sock.sendall("quit()\n".encode("utf-8"))
128128
t.join() # wait for the EOF response
129129
except KeyboardInterrupt:
130130
print("replclient: Ctrl+C pressed, forcing disconnect.")

unpythonic/net/server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def handle(self):
186186

187187
def on_socket_disconnect(adaptor):
188188
server_print('PTY on {} for client {} disconnected by client.'.format(os.ttyname(adaptor.slave), client_address_str))
189-
os.write(adaptor.master, "exit()\n".encode("utf-8")) # as if this text arrived from the socket
189+
os.write(adaptor.master, "quit()\n".encode("utf-8")) # as if this text arrived from the socket
190190
def on_slave_disconnect(adaptor):
191191
server_print('PTY on {} for client {} disconnected by PTY slave.'.format(os.ttyname(adaptor.slave), client_address_str))
192192
adaptor = PTYSocketProxy(self.request, on_socket_disconnect, on_slave_disconnect)
@@ -301,7 +301,7 @@ def start(locals, addr=None, port=1337, banner=None):
301301
default_msg = ("Unpythonic REPL server at {addr}:{port}, on behalf of:\n"
302302
" {argv}\n"
303303
" Top-level assignments and definitions update the module's globals.\n"
304-
" exit() or a blank command disconnects this session.\n"
304+
" quit() or EOF (Ctrl+D) at the prompt disconnects this session.\n"
305305
" halt() tells the server to close after the last session has disconnected.\n"
306306
" print() prints in the REPL session.\n"
307307
" server_print(...) prints on the stdout of the server.")

0 commit comments

Comments
 (0)