From fe4bd0ff24402f2201bd216fe7ccc5464bd85f24 Mon Sep 17 00:00:00 2001 From: toonn Date: Wed, 29 May 2019 21:26:39 +0200 Subject: Fix py2.6 incompatible use of subprocess --- ranger/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ranger/__init__.py b/ranger/__init__.py index 2228d40e..c7091a3e 100644 --- a/ranger/__init__.py +++ b/ranger/__init__.py @@ -21,10 +21,11 @@ def version_helper(): import subprocess version_string = 'ranger-master {0}' try: - git_describe = subprocess.check_output(['git', 'describe'], - universal_newlines=True, - stderr=subprocess.PIPE) - version_string = version_string.format(git_describe.strip('\n')) + git_describe = subprocess.Popen(['git', 'describe'], + universal_newlines=True, + stdout=subprocess.PIPE) + (git_description, _) = git_describe.communicate() + version_string = version_string.format(git_description.strip('\n')) except (OSError, subprocess.CalledProcessError): version_string = version_string.format(__version__) return version_string -- cgit 1.4.1-2-gfad0