about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2021-08-08 19:43:49 +0200
committertoonn <toonn@toonn.io>2021-08-08 19:43:49 +0200
commit056f6895d403a98c78047f5ded48984864ed02aa (patch)
treeff6bdb14e059f3cc1fa0c29c4fb87af2c132e086
parent08dc11d721fbe954c955fe18592eaf140ebed082 (diff)
downloadranger-056f6895d403a98c78047f5ded48984864ed02aa.tar.gz
spawn: Use Popen23 for compatibility
-rw-r--r--ranger/ext/spawn.py9
1 files 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: