fix cython errors

This commit is contained in:
jxxghp
2025-03-23 19:09:48 +08:00
parent 4c4bf698b1
commit 740cf12c11
3 changed files with 7 additions and 7 deletions

View File

@@ -275,7 +275,7 @@ class SubscribeChain(ChainBase, metaclass=Singleton):
return True
return False
def search(self, sid: int = None, state: str = 'N', manual: bool = False):
def search(self, sid: int = None, state: Optional[str] = 'N', manual: bool = False):
"""
订阅搜索
:param sid: 订阅ID有值时只处理该订阅

View File

@@ -1,7 +1,7 @@
import base64
import hashlib
from hashlib import md5
from typing import Union
from typing import Union, Optional, Tuple
from Crypto import Random
from Crypto.Cipher import AES
@@ -13,7 +13,7 @@ from cryptography.hazmat.primitives.asymmetric import padding as asym_padding, r
class RSAUtils:
@staticmethod
def generate_rsa_key_pair(key_size: int = 2048) -> (str, str):
def generate_rsa_key_pair(key_size: int = 2048) -> Tuple[str, str]:
"""
生成RSA密钥对
:return: 私钥和公钥Base64 编码,无标识符)
@@ -46,7 +46,7 @@ class RSAUtils:
return private_key_b64, public_key_b64
@staticmethod
def verify_rsa_keys(private_key: str, public_key: str) -> bool:
def verify_rsa_keys(private_key: Optional[str], public_key: Optional[str]) -> bool:
"""
使用 RSA 验证私钥和公钥是否匹配

View File

@@ -29,9 +29,9 @@ setup(
"auto_pickle": False,
"embedsignature": True,
"annotation_typing": True,
"infer_types": False
},
annotate=True
"infer_types": True,
"binding": True,
}
),
script_args=["build_ext", "-j8", "--inplace"],
)