mirror of
https://github.com/arabianq/viking-file-python.git
synced 2026-04-28 14:31:24 +00:00
fix: now supports python3.11+
This commit is contained in:
@@ -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))
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user