Author: tack
Date: Thu Feb 14 14:06:24 2008
New Revision: 3103
Log:
Fixes for python 2.4
Modified:
trunk/base/src/notifier/coroutine.py
trunk/base/src/rpc.py
Modified: trunk/base/src/notifier/coroutine.py
==============================================================================
--- trunk/base/src/notifier/coroutine.py (original)
+++ trunk/base/src/notifier/coroutine.py Thu Feb 14 14:06:24 2008
@@ -67,7 +67,7 @@
# variable to detect if send is possible with a generator
-_python25 = sys.version.split()[0] > '2.4'
+_python25 = sys.hexversion >= 0x02050000
def _process(func, async=None):
"""
Modified: trunk/base/src/rpc.py
==============================================================================
--- trunk/base/src/rpc.py (original)
+++ trunk/base/src/rpc.py Thu Feb 14 14:06:24 2008
@@ -115,7 +115,7 @@
return create
-class RemoteException(object):
+class RemoteException(Exception):
"""
Raised when remote RPC calls raise exceptions. Instances of this class
inherit the actual remote exception class, so this works:
@@ -137,8 +137,12 @@
def __str__(self):
dump = ''.join(traceback.format_list(self._rpc_stack))
- if self.message:
- info = '%s: %s' % (self._rpc_exc_name, self.message)
+ # Python 2.5 always has self.message; for Python 2.4, fall back to
+ # first argument if it's a string.
+ msg = (hasattr(self, 'message') and self.message) or \
+ (self.args and isinstance(self.args[0], basestring) and
self.args[0])
+ if msg:
+ info = '%s: %s' % (self._rpc_exc_name, msg)
else:
info = self._rpc_exc_name
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog