diff --git a/src/ecdsa/_compat.py b/src/ecdsa/_compat.py index f409a1a2..4558e33a 100644 --- a/src/ecdsa/_compat.py +++ b/src/ecdsa/_compat.py @@ -127,7 +127,7 @@ def int_to_bytes(val, length=None, byteorder="big"): if length is None: length = byte_length(val) # for gmpy we need to convert back to native int - if type(val) != int: + if not isinstance(val, int): val = int(val) return bytearray(val.to_bytes(length=length, byteorder=byteorder)) diff --git a/tox.ini b/tox.ini index c9b07c9a..ea01c4b4 100644 --- a/tox.ini +++ b/tox.ini @@ -104,7 +104,7 @@ commands = {envpython} speed.py basepython = python3 deps = black==22.3.0 - flake8 + flake8==6.1.0 commands = flake8 setup.py speed.py src black --check --line-length 79 .