diff --git a/wcs/wf/export_to_model.py b/wcs/wf/export_to_model.py index 25da58ae4..f6bd0e065 100644 --- a/wcs/wf/export_to_model.py +++ b/wcs/wf/export_to_model.py @@ -69,8 +69,8 @@ try: subprocess.check_call(['which', 'libreoffice'], stdout=subprocess.DEVNULL) def transform_to_pdf(instream): + temp_dir = tempfile.mkdtemp() try: - temp_dir = tempfile.mkdtemp() with tempfile.NamedTemporaryFile(dir=temp_dir) as infile: while True: chunk = instream.read(100000)