From b301ad5aa7771c347dd8149f7847df618ab15c71 Mon Sep 17 00:00:00 2001 From: Liu Hancheng Date: Thu, 5 Dec 2024 11:56:32 +0800 Subject: [PATCH] dev: use inspect.iscoroutinefunction to thorough fix the await problem --- src/ossfs/async_oss.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ossfs/async_oss.py b/src/ossfs/async_oss.py index f01b501..7fcc471 100644 --- a/src/ossfs/async_oss.py +++ b/src/ossfs/async_oss.py @@ -2,6 +2,7 @@ Code of AioOSSFileSystem """ import logging +import inspect import os import weakref from datetime import datetime @@ -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)