diff --git a/osc/core.py b/osc/core.py index 30f3eddc..6d02c690 100644 --- a/osc/core.py +++ b/osc/core.py @@ -7572,6 +7572,16 @@ def return_external(filename, *args, **kwargs): cmd = filename try: + # backward compatibility for python 2.6 + if 'check_output' not in dir(subprocess): + process = subprocess.Popen(cmd, stdout=subprocess.PIPE) + output, errstr = process.communicate() + retcode = process.poll() + if retcode: + error = subprocess.CalledProcessError(retcode, cmd) + error.output = output + raise error + return output return subprocess.check_output(cmd, **kwargs) except OSError as e: if e.errno != errno.ENOENT: