mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-28 08:12:14 +08:00
🚨 remove linter error
This commit is contained in:
parent
f42d578765
commit
aaed345a20
@ -75,14 +75,14 @@ class Event(BaseEvent):
|
|||||||
if event_class is None:
|
if event_class is None:
|
||||||
return Event.parse_obj(data)
|
return Event.parse_obj(data)
|
||||||
|
|
||||||
while issubclass(event_class, Event):
|
while event_class and issubclass(event_class, Event):
|
||||||
try:
|
try:
|
||||||
return event_class.parse_obj(data)
|
return event_class.parse_obj(data)
|
||||||
except ValidationError as e:
|
except ValidationError as e:
|
||||||
logger.info(
|
logger.info(
|
||||||
f'Failed to parse {data} to class {event_class.__name__}: '
|
f'Failed to parse {data} to class {event_class.__name__}: '
|
||||||
f'{e.errors()!r}. Fallback to parent class.')
|
f'{e.errors()!r}. Fallback to parent class.')
|
||||||
event_class = event_class.__base__
|
event_class = event_class.__base__ # type: ignore
|
||||||
|
|
||||||
raise ValueError(f'Failed to serialize {data}.')
|
raise ValueError(f'Failed to serialize {data}.')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user