Only get dbus user on sudo-user-present

ib_1m_hist
Tyler Goodlet 2022-10-26 00:55:26 -04:00
parent b7ef0596b9
commit f7ec66362e
1 changed files with 5 additions and 2 deletions

View File

@ -58,8 +58,11 @@ async def notify_from_ems_status_msg(
if is_subproc:
global _dbus_uid
if not _dbus_uid:
su = os.environ['SUDO_USER']
su = os.environ.get('SUDO_USER')
if (
not _dbus_uid
and su
):
# TODO: use `trio` but we need to use nursery.start()
# to use pipes?