From c9b0a01c1fad3e97be0447c1d4421f11d25ca866 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Sat, 30 Sep 2023 22:31:31 +0200 Subject: [PATCH 1/2] _compat.py: fix "do not compare types" --- src/ecdsa/_compat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)) From 5379cf3170da0601382df82522b184d6cf3f4b80 Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Sat, 30 Sep 2023 22:33:20 +0200 Subject: [PATCH 2/2] pin version of flake8 --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 .