Skip to content

Commit b423e74

Browse files
committed
!squash fix test
1 parent 29b4abd commit b423e74

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

src/tmuxp/util.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,21 @@ def run_before_script(
3030
) -> int:
3131
"""Execute shell script, ``tee``-ing output to both terminal (if TTY) and buffer."""
3232
script_cmd = shlex.split(str(script_file))
33-
proc = subprocess.Popen(
34-
script_cmd,
35-
cwd=cwd,
36-
stdout=subprocess.PIPE,
37-
stderr=subprocess.PIPE,
38-
text=True, # decode to str
39-
errors="backslashreplace",
40-
)
33+
34+
try:
35+
proc = subprocess.Popen(
36+
script_cmd,
37+
cwd=cwd,
38+
stdout=subprocess.PIPE,
39+
stderr=subprocess.PIPE,
40+
text=True, # decode to str
41+
errors="backslashreplace",
42+
)
43+
except FileNotFoundError as e:
44+
raise exc.BeforeLoadScriptNotExists(
45+
e,
46+
os.path.abspath(script_file), # NOQA: PTH100
47+
) from e
4148

4249
out_buffer = []
4350
err_buffer = []

0 commit comments

Comments
 (0)