nonebot2/tests/plugins/param/param_exception.py
Ju4tCode bbd13c04cc
Feature: 兼容 Pydantic v2 (#2544)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-01-26 11:12:57 +08:00

11 lines
202 B
Python

from typing import Union
async def exc(e: Exception, x: Union[ValueError, TypeError]) -> Exception:
assert e == x
return e
async def legacy_exc(exception) -> Exception:
return exception