Skip to content

Commit 918da32

Browse files
committed
Code quality
1 parent 58b1759 commit 918da32

13 files changed

Lines changed: 30 additions & 335 deletions

File tree

src/depends.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def try_import(module, log_extra=False):
188188
logger.error(
189189
'On %s, try running "%s %s" as root.',
190190
dist, PACKAGE_MANAGER[dist], PACKAGES[module][dist])
191-
return False
191+
return None
192192

193193

194194
def check_ripemd160():
@@ -274,6 +274,7 @@ def check_openssl():
274274
if sys.platform == 'win32':
275275
paths = ['libeay32.dll']
276276
if getattr(sys, 'frozen', False):
277+
# pylint: disable=no-member
277278
paths.insert(0, os.path.join(sys._MEIPASS, 'libeay32.dll'))
278279
else:
279280
paths = ['libcrypto.so', 'libcrypto.so.1.0.0']

src/fallback/umsgpack/umsgpack.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,6 @@ def _pack2(obj, fp, **options):
410410
>>> umsgpack.pack({u"compact": True, u"schema": 0}, f)
411411
>>>
412412
"""
413-
global compatibility
414-
415413
ext_handlers = options.get("ext_handlers")
416414

417415
if obj is None:
@@ -480,8 +478,6 @@ def _pack3(obj, fp, **options):
480478
>>> umsgpack.pack({u"compact": True, u"schema": 0}, f)
481479
>>>
482480
"""
483-
global compatibility
484-
485481
ext_handlers = options.get("ext_handlers")
486482

487483
if obj is None:
@@ -665,7 +661,6 @@ def _unpack_string(code, fp, options):
665661
raise Exception("logic error, not string: 0x%02x" % ord(code))
666662

667663
# Always return raw bytes in compatibility mode
668-
global compatibility
669664
if compatibility:
670665
return _read_except(fp, length)
671666

src/network/bmproto.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,25 @@ def __init__(self, address=None, sock=None):
6767
# track port check requests, only allow one per connection
6868
# completely disable port checks for now
6969
self.portCheckRequested = True
70+
self.payloadLength = 0
71+
self.payloadOffset = 0
72+
self.invalid = False
73+
self.timeOffset = 0
74+
self.verackSent = False
75+
self.verackReceived = False
76+
self.payload = None
77+
self.isSSL = False
78+
self.remoteProtocolVersion = 0
79+
self.nonce = 0
80+
self.peerNode = None
81+
self.streams = None
82+
self.timestamp = 0
83+
self.object = None
84+
self.services = None
85+
self.sockNode = None
86+
self.magic = None
87+
self.checksum = None
88+
self.command = None
7089

7190
def bm_proto_reset(self):
7291
"""Reset the bitmessage object parser"""

src/network/http.py

Lines changed: 0 additions & 89 deletions
This file was deleted.

src/network/httpd.py

Lines changed: 0 additions & 161 deletions
This file was deleted.

src/network/https.py

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)