From 5eb73b4dc1c2b57229caa874677fcf2cf579a511 Mon Sep 17 00:00:00 2001 From: MrNaif2018 Date: Fri, 15 Mar 2024 20:51:43 +0300 Subject: [PATCH] Fix deprecation warnings on 3.12 --- pyproject.toml | 1 - tronpy/keys/__init__.py | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 01af582..db047dd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,6 @@ addopts = ["--cov=.", "--cov-report", "term-missing"] filterwarnings = [ "error::DeprecationWarning", "error::PendingDeprecationWarning", - "ignore:pkg_resources is deprecated as an API:DeprecationWarning", ] [tool.black] diff --git a/tronpy/keys/__init__.py b/tronpy/keys/__init__.py index 991fce0..c24cb5c 100644 --- a/tronpy/keys/__init__.py +++ b/tronpy/keys/__init__.py @@ -1,6 +1,6 @@ import hashlib import os -from collections.abc import ByteString, Hashable +from collections.abc import Hashable, Sequence from typing import Any, Iterator, Union import base58 @@ -127,7 +127,7 @@ def is_address(value: str) -> bool: return is_base58check_address(value) or is_hex_address(value) -class BaseKey(ByteString, Hashable): +class BaseKey(Sequence, Hashable): _raw_key = None # type: bytes # compatible with bytes.hex() @@ -282,7 +282,7 @@ def from_passphrase(cls, passphrase: bytes) -> "PrivateKey": return cls(sha256(passphrase)) -class Signature(ByteString): +class Signature(Sequence): """The signature object.""" _raw_signature = None