silence the systemd/dbus exception if there are no matching services (#182)

This commit is contained in:
czo 2024-08-30 18:30:31 +02:00 committed by GitHub
parent cc66fbf1df
commit 5045d8b3d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -75,6 +75,10 @@ class SystemdUnitInfo:
async def close(self) -> None:
try:
if self.__bus is not None:
try:
await self.__manager.call_get_default_target()
except:
pass
self.__bus.disconnect()
await self.__bus.wait_for_disconnect()
except Exception: