diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2007-09-27 17:57:15 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2007-09-27 17:57:15 +0100 |
commit | 79b4ea50399db59fa8459badf33918764677248d (patch) | |
tree | ad79523d3dc676cc9f8f3b7e0703343cd5e12d10 | |
parent | d8c154284ca464f493c81a4d3b5a37890d68acec (diff) | |
download | dbus-python-79b4ea50399db59fa8459badf33918764677248d.tar.gz |
Don't raise KeyError when closing private dbus.Bus. (fd.o #12096)
Also deprecate private dbus.Bus in favour of dbus.bus.BusConnection - the only
things you gain from using dbus.Bus are the shared-instance behaviour and some
strange more-than-one-way-to-do-it APIs.
-rw-r--r-- | dbus/_dbus.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/dbus/_dbus.py b/dbus/_dbus.py index bfb62f7..abcb345 100644 --- a/dbus/_dbus.py +++ b/dbus/_dbus.py @@ -71,16 +71,13 @@ class Bus(BusConnection): Connect to the appropriate bus `private` : bool If true, never return an existing shared instance, but instead - return a private connection + return a private connection. + :Deprecated: since 0.82.3. Use dbus.bus.BusConnection for + private connections. `mainloop` : dbus.mainloop.NativeMainLoop The main loop to use. The default is to use the default main loop if one has been set up, or raise an exception if none has been. - :ToDo: - - There is currently no way to connect this class to a custom - address. - - Some of this functionality should be available on - peer-to-peer D-Bus connections too. :Changed: in dbus-python 0.80: converted from a wrapper around a Connection to a Connection subclass. @@ -113,7 +110,7 @@ class Bus(BusConnection): def close(self): t = self._bus_type - if self.__class__._shared_instances[t] is self: + if self.__class__._shared_instances.get(t) is self: del self.__class__._shared_instances[t] super(Bus, self).close() |