chore: cleanup ruff flake8-simplify linter rules (#8286)

Co-authored-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
Bowen Liang 2024-09-12 12:55:45 +08:00 • committed by GitHub
commit 0f14873255
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 108 additions and 136 deletions

View file

@ -48,7 +48,8 @@ class WordExtractor(BaseExtractor):
raise ValueError(f"Check the url of your file; returned status code {r.status_code}")
self.web_path = self.file_path
self.temp_file = tempfile.NamedTemporaryFile()
# TODO: use a better way to handle the file
self.temp_file = tempfile.NamedTemporaryFile() # noqa: SIM115
self.temp_file.write(r.content)
self.file_path = self.temp_file.name
elif not os.path.isfile(self.file_path):