def _setsockopt(sock, option, value):
    """
    This wraps setting socket options since python2 vs python3 handles strings differently
    and pyzmq requires a different call. See http://pyzmq.readthedocs.io/en/latest/unicode.html
    """
    try:
        sock.setsockopt(option, value)
    except TypeError:
        sock.setsockopt_string(option, value)
