fix: now supports python3.11+

This commit is contained in:
2026-02-20 22:22:37 +03:00
parent 11062107f1
commit b653ed5986
6 changed files with 190 additions and 11 deletions
-2
View File
@@ -1,6 +1,5 @@
import asyncio
from pathlib import Path
from warnings import deprecated
from aiohttp import ClientSession
@@ -57,7 +56,6 @@ class VikingClient(AsyncVikingClient):
def upload_remote_file(self, url: str, filename: str = "", path: str = ""):
return self._loop.run_until_complete(super().upload_remote_file(url, filename, path))
@deprecated("Use upload_file instead", category=None)
def upload_file_legacy(self, filepath: Path | str, path: str = ""):
return self._loop.run_until_complete(super().upload_file_legacy(filepath, path))
+5 -3
View File
@@ -3,7 +3,6 @@ import atexit
import json
import os
from pathlib import Path
from warnings import deprecated
from itertools import chain
import aiofiles
@@ -377,7 +376,11 @@ class AsyncVikingClient:
async for line in api_response.content:
line = line.strip()
line_json = json.loads(line)
try:
line_json = json.loads(line)
except json.JSONDecodeError:
raise ApiException(line)
if line_json.get("progress"):
continue
@@ -391,7 +394,6 @@ class AsyncVikingClient:
raise ApiException(await api_response.text())
@deprecated("Use upload_file instead", category=None)
async def upload_file_legacy(self, filepath: Path | str, path: str = ""):
"""
THIS METHOD IS DEPRECATED, USE upload_file INSTEAD