From ca5ed85c0ae0964c50b7cd75d2a0b0a8eb69504d Mon Sep 17 00:00:00 2001 From: Kevin Lyda <kevin@ie.suberic.net> Date: Wed, 4 Jan 2017 18:07:24 +0000 Subject: [PATCH] Use subprocess module. os.popen2 is deprecated on python because why not? Use subprocess module instead. --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index cb18f13..9b55e17 100755 --- a/setup.py +++ b/setup.py @@ -19,6 +19,7 @@ This installs the chkcrontab command and the crontab.check module. """ import os +import subprocess import sys from distutils import file_util from distutils import log @@ -27,7 +28,8 @@ from distutils.core import setup from distutils.core import Command BASE_DIR = os.path.dirname(globals().get('__file__', os.getcwd())) -VERSION = os.popen2('git describe --dirty="*" --always')[1].readline().strip() +VERSION = subprocess.check_output( + ['git', 'describe', '--dirty=*', '--always']).strip() open('_version.py', 'w').write('__version__ = "%s"\n' % VERSION) class TestCmd(Command): -- GitLab