From 056f6895d403a98c78047f5ded48984864ed02aa Mon Sep 17 00:00:00 2001 From: toonn Date: Sun, 8 Aug 2021 19:43:49 +0200 Subject: spawn: Use Popen23 for compatibility --- ranger/ext/spawn.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ranger/ext/spawn.py b/ranger/ext/spawn.py index d4590c48..c237d88a 100644 --- a/ranger/ext/spawn.py +++ b/ranger/ext/spawn.py @@ -4,7 +4,10 @@ from __future__ import (absolute_import, division, print_function) from os import devnull -from subprocess import Popen, PIPE, CalledProcessError +from subprocess import PIPE, CalledProcessError + +from ranger.ext.popen23 import Popen23 + ENCODING = 'utf-8' @@ -28,11 +31,11 @@ def check_output(popenargs, **kwargs): kwargs.setdefault('shell', isinstance(popenargs, str)) if 'stderr' in kwargs: - with Popen(popenargs, **kwargs) as process: + with Popen23(popenargs, **kwargs) as process: stdout, _ = process.communicate() else: with open(devnull, mode='w') as fd_devnull: - with Popen(popenargs, stderr=fd_devnull, **kwargs) as process: + with Popen23(popenargs, stderr=fd_devnull, **kwargs) as process: stdout, _ = process.communicate() if process.returncode != 0: -- cgit 1.4.1-2-gfad0