[sugar] [PATCH] services/presence/server_plugin.py: Ensure _conn always exists (even if None)

Simon McVittie simon.mcvittie at collabora.co.uk
Mon May 21 07:20:37 EDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This means cleanup() will not fail on an uninitialized server plugin,
and get_connection() will return None rather than raising AttributeError.
- ---
 services/presence/server_plugin.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/services/presence/server_plugin.py b/services/presence/server_plugin.py
index d4930c9..daa31aa 100644
- --- a/services/presence/server_plugin.py
+++ b/services/presence/server_plugin.py
@@ -125,6 +125,7 @@ class ServerPlugin(gobject.GObject):
         """
         gobject.GObject.__init__(self)
 
+        self._conn = None
         self._icon_cache = BuddyIconCache()
 
         self._registry = registry
- -- 
1.5.2-rc3.GIT

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: OpenPGP key: http://www.pseudorandom.co.uk/2003/contact/ or pgp.net

iD8DBQFGUYCFWSc8zVUw7HYRAhdDAJ9om5h3LWS0XML644khlW4/N0vE9ACfWSSP
KOQHUbxQxc9SbFGibtxXgr4=
=5llQ
-----END PGP SIGNATURE-----


More information about the Sugar mailing list