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

login
register
mail settings
Submitter phabricator
Date Jan. 14, 2019, 3:12 p.m.
Message ID <14fa7e50667f1028afb095ccb71c339a@localhost.localdomain>
Download mbox | patch
Permalink /patch/37736/
State Not Applicable
Headers show

Comments

phabricator - Jan. 14, 2019, 3:12 p.m.
Mathiasdm updated this revision to Diff 13208.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5570?vs=13175&id=13208

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

AFFECTED FILES
  contrib/packaging/hg-docker

CHANGE DETAILS




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

Patch

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 @@ 
     ]
 
     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 = []