Matthias Bisping 06ea0be8aa refactoring
2022-03-16 13:21:20 +01:00

10 lines
195 B
Python

import tempfile
from contextlib import contextmanager
@contextmanager
def temporary_pdf_file(pdf: bytes):
with tempfile.NamedTemporaryFile() as f:
f.write(pdf)
yield f.name