tests/tinyproxy.py
changeset 49279 127d33e63d1a
parent 48875 6000f5b25c9b
parent 49274 b5fe10b3c9f5
child 52640 24ee91ba9aa8
--- a/tests/tinyproxy.py	Thu Jun 02 23:57:56 2022 +0200
+++ b/tests/tinyproxy.py	Wed Jun 08 15:46:04 2022 +0200
@@ -73,12 +73,8 @@
         print("\t" "connect to %s:%d" % host_port)
         try:
             soc.connect(host_port)
-        except socket.error as arg:
-            try:
-                msg = arg[1]
-            except (IndexError, TypeError):
-                msg = arg
-            self.send_error(404, msg)
+        except socket.error as e:
+            self.send_error(404, e.strerror)
             return 0
         return 1