Friendlier connection error for docker-osx users

This commit is contained in:
Aanand Prasad 2014-02-04 14:42:55 -08:00
commit 5126649de4
2 changed files with 14 additions and 2 deletions

View file

@ -4,6 +4,7 @@ from __future__ import division
import datetime
import os
import socket
import subprocess
from .errors import UserError
@ -108,3 +109,11 @@ def split_buffer(reader, separator):
if len(buffered) > 0:
yield buffered
def call_silently(*args, **kwargs):
"""
Like subprocess.call(), but redirects stdout and stderr to /dev/null.
"""
with open(os.devnull, 'w') as shutup:
return subprocess.call(*args, stdout=shutup, stderr=shutup, **kwargs)