File tree Expand file tree Collapse file tree 1 file changed +1
-6
lines changed
src/lapidary/runtime/model Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Original file line number Diff line number Diff line change 1
1
import dataclasses as dc
2
2
import inspect
3
3
from collections .abc import Sequence
4
- from typing import Union
5
4
6
5
import httpx
7
6
import typing_extensions as typing
@@ -47,11 +46,7 @@ def handle_response(self, response: httpx.Response) -> typing.Any:
47
46
48
47
fields : typing .MutableMapping [str , typing .Any ] = {}
49
48
for field_name , field_info in typ .model_fields .items ():
50
- handlers : Sequence [Union [ResponsePartHandler , type [ResponsePartHandler ]]] = [
51
- anno
52
- for anno in field_info .metadata
53
- if isinstance (anno , ResponsePartHandler ) or (inspect .isclass (anno ) and issubclass (anno , ResponsePartHandler ))
54
- ]
49
+ handlers : Sequence [ResponsePartHandler ] = [anno for anno in field_info .metadata if isinstance (anno , ResponsePartHandler )]
55
50
assert len (handlers ) == 1
56
51
handler = handlers [0 ]
57
52
if isinstance (handler , PropertyAnnotation ):
You can’t perform that action at this time.
0 commit comments