[become] DBUS_SESSION_BUS_ADDRESS may not exists

This commit is contained in:
Oleksii Shevchuk 2017-06-19 07:46:12 +03:00
parent 9b6a87249d
commit bd13f36497
1 changed files with 1 additions and 1 deletions

View File

@ -49,7 +49,7 @@ def become(user):
if os.path.exists(user_dbus_socket):
os.environ['DBUS_SESSION_BUS_ADDRESS'] = 'unix:path='+user_dbus_socket
else:
elif 'DBUS_SESSION_BUS_ADDRESS' in os.environ:
del os.environ['DBUS_SESSION_BUS_ADDRESS']
for var in os.environ.keys():