Skip to content

Commit ca521c2

Browse files
agnersclaude
andauthored
Fix typeguard error in API decorator wrapper functions (#6350)
Co-authored-by: Claude <[email protected]>
1 parent 6042694 commit ca521c2

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

supervisor/api/utils.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,10 @@ def json_loads(data: Any) -> dict[str, Any]:
6363
def api_process(method):
6464
"""Wrap function with true/false calls to rest api."""
6565

66-
async def wrap_api(
67-
api: CoreSysAttributes, *args, **kwargs
68-
) -> web.Response | web.StreamResponse:
66+
async def wrap_api(*args, **kwargs) -> web.Response | web.StreamResponse:
6967
"""Return API information."""
7068
try:
71-
answer = await method(api, *args, **kwargs)
69+
answer = await method(*args, **kwargs)
7270
except BackupFileNotFoundError as err:
7371
return api_return_error(err, status=404)
7472
except APIError as err:
@@ -109,12 +107,10 @@ def api_process_raw(content, *, error_type=None):
109107
def wrap_method(method):
110108
"""Wrap function with raw output to rest api."""
111109

112-
async def wrap_api(
113-
api: CoreSysAttributes, *args, **kwargs
114-
) -> web.Response | web.StreamResponse:
110+
async def wrap_api(*args, **kwargs) -> web.Response | web.StreamResponse:
115111
"""Return api information."""
116112
try:
117-
msg_data = await method(api, *args, **kwargs)
113+
msg_data = await method(*args, **kwargs)
118114
except APIError as err:
119115
return api_return_error(
120116
err,

0 commit comments

Comments
 (0)