changeset 31414:d63748b78769

Fix purple-remote on Python 2.6+. Use Exception objects instead of string exceptions, which are no longer supported on 2.6+. Fixes #12151. committer: Elliott Sales de Andrade <qulogic@pidgin.im>
author Ari Pollak <ari@debian.org>
date Sat, 27 Nov 2010 22:36:49 +0000
parents 72e6fa6caecc
children a42f7d3ad459
files ChangeLog libpurple/purple-remote
diffstat 2 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Nov 27 07:56:27 2010 +0000
+++ b/ChangeLog	Sat Nov 27 22:36:49 2010 +0000
@@ -1,6 +1,10 @@
 Pidgin and Finch: The Pimpin' Penguin IM Clients That're Good for the Soul
 
 version 2.7.8 (??/??/????):
+	General:
+	* Fix the exceptions in purple-remote on Python 2.6+. (Ari Pollak)
+	  (#12151)
+
 	MSN:
 	* Don't show ourselves in the list of endpoints that can be disconnected.
 
--- a/libpurple/purple-remote	Sat Nov 27 07:56:27 2010 +0000
+++ b/libpurple/purple-remote	Sat Nov 27 22:36:49 2010 +0000
@@ -36,7 +36,8 @@
     def __call__(self, *args):
         result = self.cobj.obj.__getattr__(self.attr)(*args)
         if result == 0:
-            raise "Error: " + self.attr + " " + str(args) + " returned " + str(result)
+            raise Exception("Error: %s %s returned %s" %
+                            (self.attr, args, result))
         return result
             
 def show_help(requested=False):
@@ -223,7 +224,7 @@
                             elif type == "i":
                                 methodparams.append(int(value))
                             else:
-                                raise "Don't know how to handle type \"%s\"" % type
+                                raise Exception("Don't know how to handle type \"%s\"" % type)
                     return purple.__getattr__(command)(*methodparams)
             show_help()