()
Disables (deactivates) the Splitbrain machinery
Disables (deactivates) the Splitbrain machinery
Disables ( deactivates ) the Splitbrain machinery
def disable_splitbrain():
    """Disables (deactivates) the Splitbrain machinery"""
    global _enabled
    if not _enabled:
        return
    _enabled = False
    for funcname, origfunc in _prev_builtins.items():
        setattr(builtins, funcname, origfunc)
    for modname, mod in sys.modules.items():
        if isinstance(mod, RoutedModule):
            sys.modules[modname] = mod.__realmod__
            for ref in gc.get_referrers(mod):
                if isinstance(ref, dict) and "__name__" in ref and ref.get("__file__") is not None:
                    for k, v in ref.items():
                        if v is mod:
                            ref[k] = mod.__realmod__
    sys.modules["sys"] = sys
    builtins.__import__ = _orig_import
def disable_splitbrain ( ) : global _enabled if not _enabled : return _enabled = False for funcname , origfunc in _prev_builtins . items ( ) : setattr ( builtins , funcname , origfunc ) for modname , mod in sys . modules . items ( ) : if isinstance ( mod , RoutedModule ) : sys . modules [ modname ] = mod . __realmod__ for ref in gc . get_referrers ( mod ) : if isinstance ( ref , dict ) and "__name__" in ref and ref . get ( "__file__" ) is not None : for k , v in ref . items ( ) : if v is mod : ref [ k ] = mod . __realmod__ sys . modules [ "sys" ] = sys builtins . __import__ = _orig_import