From b46bf147423b1f497d9f2bceea0e42d8ee322fab Mon Sep 17 00:00:00 2001 From: Jedd Morgan <45512892+JR-Morgan@users.noreply.github.com> Date: Wed, 1 Nov 2023 14:16:01 +0000 Subject: [PATCH] print std out as string --- main.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index c11ea3d..93d8f1c 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,6 @@ """This module contains the business logic of the function. -use the automation_context module to wrap your function in an Autamate context helper +use the automation_context module to wrap your function in an Automate context helper """ import json @@ -10,7 +10,7 @@ ) from pathlib import Path -from subprocess import run, STDOUT +from subprocess import run SCREENSHOTS_PATH = "./Screenshots" @@ -45,14 +45,13 @@ def automate_function( ], capture_output=True, text=True, - stdout=STDOUT, - stderr=STDOUT ) - print("Blender subprocess finished with exit code {returncode}") + print(f"Blender subprocess finished with exit code {process.returncode}") + print(process.stdout) print(process.stderr) - if (returncode := process.returncode) != 0: - automate_context.mark_run_failed(f"The blender process exited with error code {returncode}\n{process.stdout}") + if process.returncode != 0: + automate_context.mark_run_failed(f"The blender process exited with error code {process.returncode}\n{process.stdout}") else: files = list(Path(SCREENSHOTS_PATH).glob("**/*.png")) for file_path in files: