[PATCH] Import CHECKADDRINUSE from errno and drop "errno." when it is referenced. Was causing an exception.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Bryan Schmersal <bryan.schmersal@xxxxxxxxxxxxx>

---
 rpc/rpc.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rpc/rpc.py b/rpc/rpc.py
index 124e97a..84088f6 100644
--- a/rpc/rpc.py
+++ b/rpc/rpc.py
@@ -6,7 +6,7 @@ import struct
 import threading
 import logging
 from collections import deque as Deque
-from errno import EINPROGRESS, EWOULDBLOCK
+from errno import EINPROGRESS, EWOULDBLOCK, EADDRINUSE
 
 from . import rpc_pack
 from .rpc_const import *
@@ -846,7 +846,7 @@ class ConnectionHandler(object):
                 s.bind(('', using))
                 return
             except OSError as why:
-                if why.errno == errno.EADDRINUSE:
+                if why.errno == EADDRINUSE:
                     using += 1
                     if port < 1024 <= using:
                         # If we ask for a secure port, make sure we don't
-- 
2.34.1





[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux