fix issues raising pylint warnings

+ small bug fixes

Change-Id: Ib63bf13ad06446d3ec3b8cd0b16f9426cef9e3f4
This commit is contained in:
2021-07-06 16:23:06 +02:00
parent 039ece9549
commit d9cc85c1df
6 changed files with 10 additions and 12 deletions

View File

@ -26,6 +26,7 @@ import socketserver
import sys
import threading
import time
import errno
from secop.datatypes import BoolType, StringType
from secop.errors import SECoPError
@ -192,9 +193,9 @@ class TCPServer(socketserver.ThreadingTCPServer):
self, ('0.0.0.0', port), TCPRequestHandler, bind_and_activate=True)
break
except OSError as e:
if e.args[0] == 98: # address already in use
if e.args[0] == errno.EADDRINUSE: # address already in use
# this may happen despite of allow_reuse_address
time.sleep(0.3 * (1 << ntry))
time.sleep(0.3 * (1 << ntry)) # max accumulated sleep time: 0.3 * 31 = 9.3 sec
else:
self.log.error('could not initialize TCP Server: %r' % e)
raise