From 5ebb61596ecb65815149b53e1c91a7f0e98e6126 Mon Sep 17 00:00:00 2001 From: Ben Gardiner Date: Fri, 22 Jul 2022 13:54:58 +0000 Subject: [PATCH] don't try to resolve /dev/xxx On my machine (at least) the gethostbyname() call with `/dev/ttyACM0` hangs (for at least 10minutes, probably indefinitely but who can wait that long) --- rshell/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rshell/main.py b/rshell/main.py index 7a810d9..c70e8b1 100755 --- a/rshell/main.py +++ b/rshell/main.py @@ -1386,6 +1386,10 @@ def add_arg(*args, **kwargs): def connect(port, baud=115200, user='micro', password='python', wait=0): """Tries to connect automagically via network or serial.""" + if port.startswith('/'): + connect_serial(port, baud=baud, wait=wait) + return + try: ip_address = socket.gethostbyname(port) #print('Connecting to ip', ip_address)