def _get_stdout_binary():
    try:
        return sys.stdout.buffer
    except __HOLE__:
        pass
    try:
        fd = sys.stdout.fileno()
        return os.fdopen(fd, 'ab', 0)
    except Exception:
        pass
    try:
        return sys.__stdout__.buffer
    except AttributeError:
        pass
    try:
        fd = sys.__stdout__.fileno()
        return os.fdopen(fd, 'ab', 0)
    except Exception:
        pass
    # fallback
    return sys.stdout
dataset/ETHPy150Open alimanfoo/petl/petl/io/sources.py/_get_stdout_binary