Changeset: 8b01f267d176 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/8b01f267d176
Modified Files:
        testing/Mconvert.py.in
        testing/Mtest.py.in
        testing/malmapi.py
Branch: Sep2022
Log Message:

socket.error is a deprecated alias for OSError.


diffs (104 lines):

diff --git a/testing/Mconvert.py.in b/testing/Mconvert.py.in
--- a/testing/Mconvert.py.in
+++ b/testing/Mconvert.py.in
@@ -1286,14 +1286,14 @@ def CheckPort(port) :
     host = os.environ['HOST']
     try:
         S1.bind((host,port))
-    except socket.error as err:
+    except OSError as err:
         Serrno = err.errno
         Serrstr = err.strerror
         S1.close();
         host = 'localhost'
         try:
             S0.bind((host,port))
-        except socket.error as err:
+        except OSError as err:
             Serrno = err.errno
             Serrstr = err.strerror
             S0.close()
@@ -1716,7 +1716,7 @@ def mapi_ping(port) :
             data = sock.recv(len)
             # we don't send
             return True
-        except socket.error:
+        except OSError:
             pass
         time.sleep(wait)
     return False
@@ -2238,7 +2238,7 @@ if sys.platform == 'linux2' and CONDITIO
 # see if we can use UNIX sockets
 try:
     server = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
-except (socket.error, AttributeError):
+except (OSError, AttributeError):
     # apparently not
     SOCK = False
 else:
@@ -2659,7 +2659,7 @@ def main(argv) :
     s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
     try:
         s.bind(('::1', int(env['MAPIPORT'])))
-    except socket.error as err:
+    except OSError as err:
         CONDITIONALS['HAVE_IPV6'] = '' # False
     else:
         CONDITIONALS['HAVE_IPV6'] = '#' # True
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -2740,7 +2740,7 @@ def mapi_ping(port) :
             data = sock.recv(len)
             # we don't send
             return True
-        except socket.error:
+        except OSError:
             pass
         time.sleep(wait)
     return False
@@ -3266,7 +3266,7 @@ else:
 # see if we can use UNIX sockets
 try:
     server = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
-except (socket.error, AttributeError):
+except (OSError, AttributeError):
     # apparently not
     SOCK = False
 else:
@@ -3725,7 +3725,7 @@ def main(argv) :
     try:
         with socket.socket(socket.AF_INET6, socket.SOCK_STREAM) as s:
             s.bind(('::1', 0))
-    except socket.error as err:
+    except OSError as err:
         CONDITIONALS['HAVE_IPV6'] = False
     else:
         CONDITIONALS['HAVE_IPV6'] = True
diff --git a/testing/malmapi.py b/testing/malmapi.py
--- a/testing/malmapi.py
+++ b/testing/malmapi.py
@@ -131,20 +131,20 @@ class Connection(object):
                     self.socket.setsockopt(socket.SOL_SOCKET, 
socket.SO_KEEPALIVE, 1)
                     self.socket.setsockopt(socket.IPPROTO_TCP, 
socket.TCP_NODELAY, 1)
                     self.socket.settimeout(self.connect_timeout)
-                except socket.error as msg:
+                except OSError as msg:
                     logger.info(msg)
                     self.socket = None
                     continue
                 try:
                     self.socket.connect(sa)
-                except socket.error as msg:
+                except OSError as msg:
                     logger.info(msg.strerror)
                     self.socket.close()
                     self.socket = None
                     continue
                 break
             if self.socket is None:
-                raise socket.error("Connection refused")
+                raise OSError("Connection refused")
         else:
             self.socket = socket.socket(socket.AF_UNIX)
             self.socket.settimeout(self.connect_timeout)
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to