To enable cleanup, use as a context manager

This commit is contained in:
Trenton H
2026-01-28 15:45:27 -08:00
parent a055de0ce4
commit 7704bc5399
3 changed files with 42 additions and 13 deletions

View File

@@ -426,8 +426,8 @@ class ConsumerPlugin(
ProgressStatusOptions.WORKING,
ConsumerStatusShortMessage.PARSE_DATE,
)
date_parser = get_date_parser()
date = next(date_parser.parse(self.filename, text), None)
with get_date_parser() as date_parser:
date = next(date_parser.parse(self.filename, text), None)
archive_path = document_parser.get_archive_path()
page_count = document_parser.get_page_count(self.working_copy, mime_type)