From 3cf15cc86da12cf28a9486a87ee44381067a576c Mon Sep 17 00:00:00 2001 From: Aneesh Agrawal Date: Tue, 30 May 2017 19:39:06 -0400 Subject: [PATCH] Shim subprocess.DEVNULL for Python 2 This was introduced in Python 3.3, so provide our own version. --- python/servo/package_commands.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/python/servo/package_commands.py b/python/servo/package_commands.py index 67da3f83d5c2..d7ae4567b385 100644 --- a/python/servo/package_commands.py +++ b/python/servo/package_commands.py @@ -490,13 +490,15 @@ def call_git(cmd, **kwargs): '--message=Version Bump: {}'.format(brew_version), ]) - token = os.environ['GITHUB_HOMEBREW_TOKEN'] - call_git([ - 'push', - '-qf', - 'https://{}@github.com/servo/homebrew-servo.git'.format(token), - 'master', - ], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + push_url = 'https://{}@github.com/servo/homebrew-servo.git' + # TODO(aneeshusa): Use subprocess.DEVNULL with Python 3.3+ + with open(os.devnull, 'wb') as DEVNULL: + call_git([ + 'push', + '-qf', + push_url.format(os.environ['GITHUB_HOMEBREW_TOKEN']), + 'master', + ], stdout=DEVNULL, stderr=DEVNULL) timestamp = datetime.utcnow().replace(microsecond=0) for package in PACKAGES[platform]: