Skip to content

Commit

Permalink
Shim subprocess.DEVNULL for Python 2
Browse files Browse the repository at this point in the history
This was introduced in Python 3.3, so provide our own version.
  • Loading branch information
aneeshusa committed May 30, 2017
1 parent 1428077 commit 3cf15cc
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions python/servo/package_commands.py
Expand Up @@ -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]:
Expand Down

0 comments on commit 3cf15cc

Please sign in to comment.