-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
enhancementNew feature or requestNew feature or request
Description
In all examples involving “servers” there is a try ... finally
block:
try:
# some code
finally:
# Unregister the DBus service and objects.
SESSION_BUS.disconnect()
I would suggest to natively support the PEP 343 with
statement, in order to allow refactoring the above code as
with SESSION_BUS:
# some code
The implementation using with
-statement context managers should be straightforward.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request