💥 Remove: 移除 Python 3.9 支持 (#3860)

This commit is contained in:
呵呵です
2026-02-18 00:11:36 +08:00
committed by GitHub
parent f719a6b41b
commit 63cde5da77
56 changed files with 603 additions and 1144 deletions

View File

@@ -1,10 +1,11 @@
from collections.abc import Generator
from collections.abc import Callable, Generator
from functools import wraps
import os
from pathlib import Path
import sys
import threading
from typing import TYPE_CHECKING, Callable, TypeVar
from types import EllipsisType
from typing import TYPE_CHECKING, TypeVar
from typing_extensions import ParamSpec
from nonebug import NONEBOT_INIT_KWARGS
@@ -50,12 +51,12 @@ def anyio_backend(request: pytest.FixtureRequest):
def run_once(func: Callable[P, R]) -> Callable[P, R]:
result = ...
result: R | EllipsisType = ...
@wraps(func)
def _wrapper(*args: P.args, **kwargs: P.kwargs) -> R:
nonlocal result
if result is not Ellipsis:
if result is not ...:
return result
result = func(*args, **kwargs)