delete check_output backport: Python 2.6 no longer supported
This commit is contained in:
parent
cc5444a725
commit
77d11cd300
|
@ -49,21 +49,6 @@ client = zulip.Client(
|
||||||
api_key=config.ZULIP_API_KEY,
|
api_key=config.ZULIP_API_KEY,
|
||||||
client="ZulipGit/" + VERSION)
|
client="ZulipGit/" + VERSION)
|
||||||
|
|
||||||
# check_output is backported from subprocess.py in Python 2.7
|
|
||||||
def check_output(*popenargs, **kwargs):
|
|
||||||
if 'stdout' in kwargs:
|
|
||||||
raise ValueError('stdout argument not allowed, it will be overridden.')
|
|
||||||
process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs)
|
|
||||||
output, unused_err = process.communicate()
|
|
||||||
retcode = process.poll()
|
|
||||||
if retcode:
|
|
||||||
cmd = kwargs.get("args")
|
|
||||||
if cmd is None:
|
|
||||||
cmd = popenargs[0]
|
|
||||||
raise subprocess.CalledProcessError(retcode, cmd, output=output)
|
|
||||||
return output
|
|
||||||
subprocess.check_output = check_output
|
|
||||||
|
|
||||||
def git_repository_name():
|
def git_repository_name():
|
||||||
output = subprocess.check_output(["git", "rev-parse", "--is-bare-repository"])
|
output = subprocess.check_output(["git", "rev-parse", "--is-bare-repository"])
|
||||||
if output.strip() == "true":
|
if output.strip() == "true":
|
||||||
|
|
Loading…
Reference in a new issue