Skip to content

Commit e899ae3

Browse files
Added backward compatiblity for popenargs in subprocess.run
1 parent b298d6d commit e899ae3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Lib/subprocess.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,10 @@ def run(*popenargs,
551551
kwargs['stdout'] = PIPE
552552
kwargs['stderr'] = PIPE
553553

554+
# backward compatibility
555+
if not isinstance(popenargs, os.PathLike) and len(popenargs) == 1:
556+
popenargs = popenargs[0]
557+
554558
with Popen(popenargs, **kwargs) as process:
555559
try:
556560
stdout, stderr = process.communicate(input, timeout=timeout)

0 commit comments

Comments
 (0)