Skip to content

Commit

Permalink
Fix some pylint warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
sobomax committed Jul 11, 2024
1 parent ad3f320 commit 71c24db
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions sippy/CLIManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def run(self):
class CLIConnectionManager(object):
command_cb = None
tcp = False
accept_list = None
accept_list: list = None
serversock = None
atr = None

Expand Down Expand Up @@ -120,9 +120,10 @@ def __init__(self, command_cb, address = None, sock_owner = None, backlog = 16,

def handle_accept(self, conn, address):
#print(self.handle_accept)
if self.tcp and self.accept_list != None and address[0] not in self.accept_list:
conn.close()
return
if self.tcp and self.accept_list is not None:
if address[0] not in self.accept_list: # pylint: disable=unsupported-membership-test
conn.close()
return
try:
cm = CLIManager(conn, self.command_cb, address)
except Exception as e:
Expand Down Expand Up @@ -274,7 +275,7 @@ def shutdown(self):
try:
self.clientsock.shutdown(socket.SHUT_RDWR)
except Exception as e:
if not isinstance(e, socket.error) or e.errno != ENOTCONN:
if not isinstance(e, socket.error) or e.errno != ENOTCONN: # pylint: disable=no-member
dump_exception('self.clientsock.shutdown(socket.SHUT_RDWR)')
self.clientsock.close()
self.wthr = None
Expand Down
2 changes: 1 addition & 1 deletion sippy/Core/Exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class StdException(Exception):

def __init__(self, *args):
pin_exception(self, 2)
super(self.__class__, self).__init__(*args)
super(StdException, self).__init__(*args)

def dump_exception(msg, f = sys.stdout, extra = None):
exc_type, exc_value, exc_traceback = sys.exc_info()
Expand Down
2 changes: 1 addition & 1 deletion sippy/Security/SipNonce.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def decrypt(self, enc):
DGST_PRIOS = (DGST_SHA512, DGST_SHA512SESS, DGST_SHA256, DGST_SHA256SESS, DGST_MD5, DGST_MD5SESS)

class HashOracle(object):
try: key
try: key # pylint: disable=used-before-assignment
except: key = Random.new().read(AES.block_size * 2)
ac = None
vtime = 32 * 10**9
Expand Down

0 comments on commit 71c24db

Please sign in to comment.