# HG changeset patch # User Mathias De Mare # Date 2019-01-11 12:14:25 # Node ID 92b3811fd15f0a9d0f795e85dec520a5f5c3ee15 # Parent f3f5bfbf7e041f88d7db4f258b4f54319fefc2bd hg-docker: fix Python 3.4 compatibility (for CentOS 7) I realize Mercurial is not targetting Python 3.4 compatibility, but without this change, it's not even possible to build it on CentOS 7 (and I assume the same is true for RHEL 7). Differential Revision: https://phab.mercurial-scm.org/D5570 diff --git a/contrib/packaging/hg-docker b/contrib/packaging/hg-docker --- a/contrib/packaging/hg-docker +++ b/contrib/packaging/hg-docker @@ -72,7 +72,12 @@ def build_docker_image(dockerfile: pathl ] print('executing: %r' % args) - subprocess.run(args, input=dockerfile, check=True) + p = subprocess.Popen(args, stdin=subprocess.PIPE) + p.communicate(input=dockerfile) + if p.returncode: + raise subprocess.CalledProcessException( + p.returncode, 'failed to build docker image: %s %s' \ + % (p.stdout, p.stderr)) def command_build(args): build_args = []