changeset 41233:92b3811fd15f

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
author Mathias De Mare <mathias.de_mare@nokia.com>
date Fri, 11 Jan 2019 13:14:25 +0100
parents f3f5bfbf7e04
children 4c0d4bbdc395
files contrib/packaging/hg-docker
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/packaging/hg-docker	Tue Jan 15 11:07:34 2019 -0800
+++ b/contrib/packaging/hg-docker	Fri Jan 11 13:14:25 2019 +0100
@@ -72,7 +72,12 @@
     ]
 
     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 = []