(reactor, host='127.0.0.1', port=9051,
                               socket='/var/run/tor/control', *args, **kwargs)
This builds a connection to a local Tor, either via 127.0.0.1:9051
    or /var/run/tor/control (by default; the latter is tried
    first). See also :meth:`build_tor_connection
    <txtorcon.torstate.build_tor_connection>` for other key-word
    arguments that are accepted here also.

    **Note**: new code should use :meth:`txtorcon.connect` instead.

    :param host:
        An IP address to find Tor at. Corresponds to the
        ControlListenAddress torrc option.

    :param port:
        The port to use with the address when trying to contact
        Tor. This corresponds to the ControlPort option in torrc
        (default is 9051).
This builds a connection to a local Tor, either via 127.0.0.1:9051
    or /var/run/tor/control (by default; the latter is tried
    first). See also :meth:`build_tor_connection
    <txtorcon.torstate.build_tor_connection>` for other key-word
    arguments that are accepted here also.
This builds a connection to a local Tor either via 127 . 0 . 0 . 1 : 9051 or / var / run / tor / control ( by default ; the latter is tried first ) . See also : meth : build_tor_connection <txtorcon . torstate . build_tor_connection > for other key - word arguments that are accepted here also .
def build_local_tor_connection(reactor, host='127.0.0.1', port=9051,
                               socket='/var/run/tor/control', *args, **kwargs):
    """
    This builds a connection to a local Tor, either via 127.0.0.1:9051
    or /var/run/tor/control (by default; the latter is tried
    first). See also :meth:`build_tor_connection
    <txtorcon.torstate.build_tor_connection>` for other key-word
    arguments that are accepted here also.

    **Note**: new code should use :meth:`txtorcon.connect` instead.

    :param host:
        An IP address to find Tor at. Corresponds to the
        ControlListenAddress torrc option.

    :param port:
        The port to use with the address when trying to contact
        Tor. This corresponds to the ControlPort option in torrc
        (default is 9051).
    """

    try:
        return build_tor_connection((reactor, socket), *args, **kwargs)
    except Exception:
        return build_tor_connection((reactor, host, port), *args, **kwargs)
def build_local_tor_connection ( reactor , host = '127.0.0.1' , port = 9051 , socket = '/var/run/tor/control' , * args , * * kwargs ) : try : return build_tor_connection ( ( reactor , socket ) , * args , * * kwargs ) except Exception : return build_tor_connection ( ( reactor , host , port ) , * args , * * kwargs )