mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-09-06 20:16:47 +00:00
✅ add coverage condition annotation (#1858)
This commit is contained in:
@ -27,7 +27,7 @@ HANDLED_SIGNALS = (
|
||||
signal.SIGINT, # Unix signal 2. Sent by Ctrl+C.
|
||||
signal.SIGTERM, # Unix signal 15. Sent by `kill <pid>`.
|
||||
)
|
||||
if WINDOWS:
|
||||
if WINDOWS: # pragma: py-win32
|
||||
HANDLED_SIGNALS += (signal.SIGBREAK,) # Windows signal 21. Sent by Ctrl+Break.
|
||||
|
||||
|
||||
|
@ -15,9 +15,9 @@ from .plugin import Plugin
|
||||
from .manager import PluginManager
|
||||
from . import _managers, get_plugin, _module_name_to_plugin_name
|
||||
|
||||
try:
|
||||
try: # pragma: py-gte-311
|
||||
import tomllib # pyright: reportMissingImports=false
|
||||
except ModuleNotFoundError:
|
||||
except ModuleNotFoundError: # pragma: py-lt-311
|
||||
import tomli as tomllib
|
||||
|
||||
|
||||
|
@ -541,7 +541,7 @@ class ShellCommandRule:
|
||||
try:
|
||||
args = self.parser.parse_args(state[SHELL_ARGV])
|
||||
state[SHELL_ARGS] = args
|
||||
except ArgumentError as e:
|
||||
except ArgumentError as e: # pragma: py-gte-39
|
||||
state[SHELL_ARGS] = ParserExit(status=2, message=str(e))
|
||||
except ParserExit as e:
|
||||
state[SHELL_ARGS] = e
|
||||
|
Reference in New Issue
Block a user