mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 10:35:51 +08:00
fix: UP031 style rule violation (#3866)
This commit is contained in:
parent
9b4898efeb
commit
7919596a21
@ -29,8 +29,7 @@ class WordExtractor(BaseExtractor):
|
|||||||
|
|
||||||
if r.status_code != 200:
|
if r.status_code != 200:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Check the url of your file; returned status code %s"
|
f"Check the url of your file; returned status code {r.status_code}"
|
||||||
% r.status_code
|
|
||||||
)
|
)
|
||||||
|
|
||||||
self.web_path = self.file_path
|
self.web_path = self.file_path
|
||||||
@ -38,7 +37,7 @@ class WordExtractor(BaseExtractor):
|
|||||||
self.temp_file.write(r.content)
|
self.temp_file.write(r.content)
|
||||||
self.file_path = self.temp_file.name
|
self.file_path = self.temp_file.name
|
||||||
elif not os.path.isfile(self.file_path):
|
elif not os.path.isfile(self.file_path):
|
||||||
raise ValueError("File path %s is not a valid file or url" % self.file_path)
|
raise ValueError(f"File path {self.file_path} is not a valid file or url")
|
||||||
|
|
||||||
def __del__(self) -> None:
|
def __del__(self) -> None:
|
||||||
if hasattr(self, "temp_file"):
|
if hasattr(self, "temp_file"):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user