Unset DBUS_SESSION_BUS_ADDRESS if not exists

This commit is contained in:
Oleksii Shevchuk 2017-05-16 20:41:30 +03:00 committed by Oleksii Shevchuk
parent 21d51e6bc5
commit 466481b101
1 changed files with 2 additions and 0 deletions

View File

@ -49,6 +49,8 @@ def become(user):
if os.path.exists(user_dbus_socket):
os.environ['DBUS_SESSION_BUS_ADDRESS'] = user_dbus_socket
else:
del os.environ['DBUS_SESSION_BUS_ADDRESS']
for var in os.environ.keys():
if var.startswith(('XDG_', 'GDM', 'DESKTOP_')):