Skip to content

Commit

Permalink
dev: use inspect.iscoroutinefunction to thorough fix the await problem
Browse files Browse the repository at this point in the history
  • Loading branch information
CNLHC committed Dec 5, 2024
1 parent ce49c91 commit b301ad5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ossfs/async_oss.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Code of AioOSSFileSystem
"""
import logging
import inspect
import os
import weakref
from datetime import datetime
Expand Down Expand Up @@ -156,7 +157,7 @@ async def _call_oss(
if not method:
method = getattr(aiooss2, method_name)
logger.debug("CALL: %s - %s - %s", method.__name__, args, kwargs)
if method_name =="resumable_upload":
if inspect.iscoroutinefunction(method):
out = await method(service, *args, **kwargs)
else:
out = method(service, *args, **kwargs)
Expand Down

0 comments on commit b301ad5

Please sign in to comment.