Fixed pylint & flake8 warnings and errors.

This commit is contained in:
Joe Testa 2022-10-10 20:40:29 -04:00
parent 0b8ecf2fb5
commit b9520cbc25
3 changed files with 5 additions and 7 deletions

View File

@ -325,7 +325,7 @@ class SSH_Socket(ReadBuf, WriteBuf):
self.__header = [] self.__header = []
self.__banner = None self.__banner = None
def _close_socket(self, s: Optional[socket.socket]) -> None: # pylint: disable=no-self-use def _close_socket(self, s: Optional[socket.socket]) -> None:
try: try:
if s is not None: if s is not None:
s.shutdown(socket.SHUT_RDWR) s.shutdown(socket.SHUT_RDWR)

View File

@ -41,15 +41,15 @@ class TestPolicy:
for policy_name in Policy.BUILTIN_POLICIES: for policy_name in Policy.BUILTIN_POLICIES:
# Ensure that the policy name ends with " (version X)", where X is the 'version' field. # Ensure that the policy name ends with " (version X)", where X is the 'version' field.
version_str = " (version %s)" % Policy.BUILTIN_POLICIES[policy_name]['version'] version_str = " (version %s)" % Policy.BUILTIN_POLICIES[policy_name]['version']
assert(policy_name.endswith(version_str)) assert policy_name.endswith(version_str)
# Ensure that each built-in policy can be loaded with Policy.load_builtin_policy(). # Ensure that each built-in policy can be loaded with Policy.load_builtin_policy().
assert(Policy.load_builtin_policy(policy_name) is not None) assert Policy.load_builtin_policy(policy_name) is not None
# Ensure that both server and client policy names are returned. # Ensure that both server and client policy names are returned.
server_policy_names, client_policy_names = Policy.list_builtin_policies() server_policy_names, client_policy_names = Policy.list_builtin_policies()
assert(len(server_policy_names) > 0) assert len(server_policy_names) > 0
assert(len(client_policy_names) > 0) assert len(client_policy_names) > 0
def test_policy_basic(self): def test_policy_basic(self):

View File

@ -91,14 +91,12 @@ reports = no
#output-format = colorized #output-format = colorized
indent-string = " " indent-string = " "
disable = disable =
bad-continuation,
broad-except, broad-except,
duplicate-code, duplicate-code,
fixme, fixme,
invalid-name, invalid-name,
line-too-long, line-too-long,
missing-docstring, missing-docstring,
mixed-indentation,
no-else-raise, no-else-raise,
no-else-return, no-else-return,
super-with-arguments, # Can be re-factored, at some point. super-with-arguments, # Can be re-factored, at some point.