D5570: hg-docker: fix Python 3.4 compatibility (for CentOS 7)

Mathiasdm (Mathias De Maré) phabricator at mercurial-scm.org
Fri Jan 11 09:28:31 EST 2019


Mathiasdm created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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).

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D5570

AFFECTED FILES
  contrib/packaging/hg-docker

CHANGE DETAILS

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,10 @@
     ]
 
     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 Exception('failed to build docker image: %s %s' % (p.stdout, p.stderr))
 
 def command_build(args):
     build_args = []



To: Mathiasdm, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list