Runs pyupgrade to Python 3.8+ and adds a hook for it

This commit is contained in:
Trenton Holmes
2022-05-06 09:04:08 -07:00
parent 7909b30b4b
commit 3003bdd507
34 changed files with 113 additions and 109 deletions

View File

@@ -18,7 +18,7 @@ class TextDocumentParser(DocumentParser):
def get_thumbnail(self, document_path, mime_type, file_name=None):
def read_text():
with open(document_path, "r") as src:
with open(document_path) as src:
lines = [line.strip() for line in src.readlines()]
text = "\n".join(lines[:50])
return text
@@ -38,5 +38,5 @@ class TextDocumentParser(DocumentParser):
return out_path
def parse(self, document_path, mime_type, file_name=None):
with open(document_path, "r") as f:
with open(document_path) as f:
self.text = f.read()