From 2a13e783f94be23c3fa2d795e36dd903a7d24585 Mon Sep 17 00:00:00 2001 From: Steve Rowe Date: Mon, 2 Oct 2017 13:34:30 -0400 Subject: [PATCH] buildAndPushRelease.py: use wait() instead of poll() to check for process completion --- dev-tools/scripts/buildAndPushRelease.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dev-tools/scripts/buildAndPushRelease.py b/dev-tools/scripts/buildAndPushRelease.py index 1143ebfbd34..cd2fdd16b52 100644 --- a/dev-tools/scripts/buildAndPushRelease.py +++ b/dev-tools/scripts/buildAndPushRelease.py @@ -53,9 +53,14 @@ def runAndSendGPGPassword(command, password): p.stdin.write((password + '\n').encode('UTF-8')) p.stdin.write('\n'.encode('UTF-8')) - result = p.poll() - if result is not None: - msg = ' FAILED: %s [see log %s]' % (command, LOG) + try: + result = p.wait(timeout=120) + if result != 0: + msg = ' FAILED: %s [see log %s]' % (command, LOG) + print(msg) + raise RuntimeError(msg) + except TimeoutExpired: + msg = ' FAILED: %s [timed out after 2 minutes; see log %s]' % (command, LOG) print(msg) raise RuntimeError(msg)