Skip to content

Code quality #1773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: v0.6
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/network/tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
class TLSDispatcher(AdvancedDispatcher):
"""TLS functionality for classes derived from AdvancedDispatcher"""
# pylint: disable=too-many-instance-attributes, too-many-arguments
# pylint: disable=super-init-not-called
# pylint: disable=super-init-not-called, unused-argument
def __init__(self, _=None, sock=None, certfile=None, keyfile=None,
server_side=False, ciphers=sslProtocolCiphers):
self.want_read = self.want_write = True
Expand Down
10 changes: 9 additions & 1 deletion src/network/udp.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class UDPSocket(BMProto): # pylint: disable=too-many-instance-attributes
port = 8444

def __init__(self, host=None, sock=None, announcing=False):
# pylint: disable=bad-super-call
# pylint: disable=bad-super-call, access-member-before-definition
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bug: pylint-dev/pylint#2315

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linked bug has been fixed. The ignore shouldn't be needed anymore.

super(BMProto, self).__init__(sock=sock)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super(UDPSocket, self).__init__(sock=sock)

?

self.verackReceived = True
self.verackSent = True
Expand Down Expand Up @@ -97,22 +97,30 @@ def bm_command_addr(self):
time.time()
return True

# override the protocol do ignore the following commands on UDP
# we do this mainly for security reasons
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more of inheritance flow. Maybe UDPSocket should inherit from some more basic class?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps.

def bm_command_portcheck(self):
# pylint: disable=no-self-use
return True

def bm_command_ping(self):
# pylint: disable=no-self-use
return True

def bm_command_pong(self):
# pylint: disable=no-self-use
return True

def bm_command_verack(self):
# pylint: disable=no-self-use
return True

def bm_command_version(self):
# pylint: disable=no-self-use
return True

def handle_connect(self):
# pylint: disable=no-self-use
return

def writable(self):
Expand Down