from utils.api.login import Login
File "/root/sign/utils/api/login.py", line 17, in <module>
from .sign import BaseSign
File "/root/sign/utils/api/sign.py", line 17, in <module>
from ..utils import get_random_chars_as_string, is_incorrect_return
File "/root/sign/utils/utils.py", line 95, in <module>
async def get_token_by_captcha(url: str) -> str | bool:
TypeError: unsupported operand type(s) for |: 'type' and 'type'
File "/root/sign/miuitask.py", line 15, in <module>
from utils.api.login import Login
File "/root/sign/utils/api/login.py", line 17, in <module>
from .sign import BaseSign
File "/root/sign/utils/api/sign.py", line 17, in <module>
from ..utils import get_random_chars_as_string, is_incorrect_return
File "/root/sign/utils/utils.py", line 95, in <module>
async def get_token_by_captcha(url: str) -> str | bool:
TypeError: unsupported operand type(s) for |: 'type' and 'type'
Verify Steps
MIUITask Version
v1.7.6-hotfix1
Bug Found in Environment
Linux
Bug Found in Python Version
3.8
Describe the Bug
在windows系统下使用3.11版本的python可以正常运行脚本,但是换用玩客云上的3.8版本python执行脚本报错,提示:
经过查找资料得知在python3.10之前,联合类型并不直接被支持作为类型注解。因为玩客云本身的源只有3.8版本的python,所以按照ChatGPT的提示,引入typing.Union之后把类型注解改为
Union[str, bool]
之后就能正常运行了。希望能更新一下Readme,提示用户更新自己的python版本到3.10或者以上的版本MIUITask Log
MIUITask Config
No response
Screenshots
No response