Skip to content

Commit feb038f

Browse files
committed
Code quality
1 parent 58b1759 commit feb038f

5 files changed

Lines changed: 15 additions & 11 deletions

File tree

src/depends.py

Lines changed: 3 additions & 2 deletions
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,7 +274,8 @@ def check_openssl():
274274
if sys.platform == 'win32':
275275
paths = ['libeay32.dll']
276276
if getattr(sys, 'frozen', False):
277-
paths.insert(0, os.path.join(sys._MEIPASS, 'libeay32.dll'))
277+
# pylint: disable=no-member
278+
paths.insert(0, os.path.join(sys._MEIPASS, 'libeay32.dll'))
278279
else:
279280
paths = ['libcrypto.so', 'libcrypto.so.1.0.0']
280281
if sys.platform == 'darwin':

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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ 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.payloadOffset = 0
71+
self.invalid = False
72+
self.timeOffset = 0
73+
self.verackSent = False
74+
self.payload = None
75+
self.isSSL = False
76+
self.remoteProtocolVersion = 0
77+
self.nonce = 0
7078

7179
def bm_proto_reset(self):
7280
"""Reset the bitmessage object parser"""

src/shared.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import sys
1616
from binascii import hexlify
1717

18-
from six.moves.reprlib import repr # pylint: disable=redefined-builtin
18+
from six.moves.reprlib import repr # pylint: disable=redefined-builtin,import-error
1919

2020
# Project imports.
2121
import highlevelcrypto

tests-kivy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def unittest_discover():
2222
if in_docker:
2323
try:
2424
os.mkdir("../out")
25-
except FileExistsError: # noqa:F821
25+
except FileExistsError: # noqa:F821 pylint: disable=undefined-variable
2626
pass
2727

2828
ffmpeg = subprocess.Popen([ # pylint: disable=consider-using-with
@@ -38,7 +38,7 @@ def unittest_discover():
3838
if in_docker:
3939
ffmpeg.terminate()
4040
try:
41-
ffmpeg.wait(10)
42-
except subprocess.TimeoutExpired:
41+
ffmpeg.wait(10) # pylint: disable=too-many-function-args
42+
except subprocess.TimeoutExpired: # pylint: disable=no-member
4343
ffmpeg.kill()
4444
sys.exit(not result.wasSuccessful())

0 commit comments

Comments
 (0)