Skip to content

Commit f434805

Browse files
committed
Ensure that the subprocess for wrapped tools is always destroyed
1 parent 61e927a commit f434805

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

rnaseq_pipeline/wrapped_tools.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ def move_directory(from_dir, to_dir):
6666
shutil.move(from_dir, to_dir)
6767

6868
def subprocess_run(args, **kwargs):
69-
proc = subprocess.Popen(args, **kwargs)
70-
with ExternalProgramRunContext(proc):
71-
proc.wait()
72-
return proc.returncode
69+
with subprocess.Popen(args, **kwargs) as proc:
70+
with ExternalProgramRunContext(proc):
71+
proc.wait()
72+
return proc.returncode
7373

7474
def rsem_calculate_expression_wrapper():
7575
"""Wrapper script for RSEM that copies the reference to a local temporary directory."""

0 commit comments

Comments
 (0)