Each shell will use a different socket in the $XDG_RUNTIME_DIR. A safer check is to see if $MIR_SOCKET is defined (though the shell might currently not define that either).
I'd recommend at least a big comment on why this is a temporary solution or check for the environment variable and optionally the socket.
This is likely to break in the future:
102 +def _get_correct_ backend( ): '/tmp/mir_ socket' ):
103 + if exists(
104 + import _mir
Each shell will use a different socket in the $XDG_RUNTIME_DIR. A safer check is to see if $MIR_SOCKET is defined (though the shell might currently not define that either).
I'd recommend at least a big comment on why this is a temporary solution or check for the environment variable and optionally the socket.