chore: use posixpath to wrapper filepath (#9976)

This commit is contained in:
ice yao 2024-11-07 19:31:49 +08:00 committed by GitHub
parent 0b16270b88
commit dd5ffaf058
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,3 +1,4 @@
import posixpath
from collections.abc import Generator
import oss2 as aliyun_s3
@ -50,9 +51,4 @@ class AliyunOssStorage(BaseStorage):
self.client.delete_object(self.__wrapper_folder_filename(filename))
def __wrapper_folder_filename(self, filename) -> str:
if self.folder:
if self.folder.endswith("/"):
filename = self.folder + filename
else:
filename = self.folder + "/" + filename
return filename
return posixpath.join(self.folder, filename) if self.folder else filename