Skip to content

Commit 9cda95f

Browse files
authored
Merge pull request #15567 from mcgratta/master
Python: Fix subprocess.run syntax
2 parents a65f8c4 + 5c33114 commit 9cda95f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Utilities/Python/scripts/make_smv_images.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
if shutil.which("xvfb-run") is None:
2121
raise FileNotFoundError("xvfb-run is not installed. Please install xvfb package.")
2222

23+
bindir = '../../../smv/Build/for_bundle'
2324
outdir = '../../Verification/'
2425
original_dir = os.getcwd()
2526

@@ -39,8 +40,15 @@
3940
print('generating smokeview image ' + case[i])
4041
os.chdir(outdir + folder[i])
4142
if os_name == "Linux":
42-
subprocess.run(['xvfb-run','-w 10 -s "-fp /usr/share/X11/fonts/misc -screen 0 1280x1024x24" -a',smokeview_path,'-bindir ../../../smv/Build/for_bundle -runscript',case[i]], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
43+
try:
44+
subprocess.run(['xvfb-run','-w','10','-s','-fp /usr/share/X11/fonts/misc -screen 0 1280x1024x24','-a',smokeview_path,
45+
'-bindir',bindir,'-runscript', case[i] ], check=True)
46+
except subprocess.CalledProcessError as e:
47+
print(f"Smokeview failed with return code {e.returncode}")
48+
except FileNotFoundError:
49+
print(f"Smokeview executable not found: {smokeview_path}")
50+
4351
else:
44-
subprocess.run([smokeview_path,'-bindir ../../../smv/Build/for_bundle -runscript',case[i]], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
52+
subprocess.run([smokeview_path,'-bindir',bindir,'-runscript',case[i]], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
4553
os.chdir(original_dir)
4654

0 commit comments

Comments
 (0)