()
Return to operate on the local machine. You can enter this context only after calling ``enable()``
Return to operate on the local machine. You can enter this context only after calling ``enable()``
Return to operate on the local machine . You can enter this context only after calling enable ()
def localbrain():
    """Return to operate on the local machine. You can enter this context only after calling ``enable()``"""
    if not _enabled:
        raise ValueError("Splitbrain not enabled")
    prev_conn = getattr(router, "conn", None)
    prev_modules = sys.modules.copy()
    if hasattr(router, "conn"):
        del router.conn
    try:
        yield
    finally:
        sys.modules.clear()
        sys.modules.update(prev_modules)
        router.conn = prev_conn
        if not router.conn:
            del router.conn
def localbrain ( ) : if not _enabled : raise ValueError ( "Splitbrain not enabled" ) prev_conn = getattr ( router , "conn" , None ) prev_modules = sys . modules . copy ( ) if hasattr ( router , "conn" ) : del router . conn try : yield finally : sys . modules . clear ( ) sys . modules . update ( prev_modules ) router . conn = prev_conn if not router . conn : del router . conn