Author: phd
Date: Tue Jul 5 09:19:27 2011
New Revision: 4424
Log:
Neil Muller fixed a bug in pydispatcher that prevented to install it under pypy.
Modified:
SQLObject/trunk/docs/Authors.txt
SQLObject/trunk/sqlobject/include/pydispatch/robustapply.py
Modified: SQLObject/trunk/docs/Authors.txt
==============================================================================
--- SQLObject/trunk/docs/Authors.txt Fri Jul 1 08:59:32 2011 (r4423)
+++ SQLObject/trunk/docs/Authors.txt Tue Jul 5 09:19:27 2011 (r4424)
@@ -24,6 +24,7 @@
* Christopher Singley <csingley at gmail.com>
* David Keeney <dkeeney at rdbhost.com>
* Daniel Fetchinson <fetchinson at googlemail.com>
+* Neil Muller <drnlmuller+sqlobject at gmail.com>
* Oleg Broytman <ph...@ph...>
.. image:: http://sflogo.sourceforge.net/sflogo.php?group_id=74338&type=10
Modified: SQLObject/trunk/sqlobject/include/pydispatch/robustapply.py
==============================================================================
--- SQLObject/trunk/sqlobject/include/pydispatch/robustapply.py Fri Jul 1 08:59:32 2011 (r4423)
+++ SQLObject/trunk/sqlobject/include/pydispatch/robustapply.py Tue Jul 5 09:19:27 2011 (r4424)
@@ -14,17 +14,14 @@
If fromMethod is true, then the callable already
has its first argument bound
"""
- if hasattr(receiver, '__call__'):
- # receiver is a class instance; assume it is callable.
- # Reassign receiver to the actual method that will be called.
- if hasattr( receiver.__call__, 'im_func') or hasattr( receiver.__call__, 'im_code'):
- receiver = receiver.__call__
- if hasattr( receiver, 'im_func' ):
- # an instance-method...
+ if hasattr(receiver, 'im_func'):
return receiver, receiver.im_func.func_code, 1
- elif not hasattr( receiver, 'func_code'):
+ elif hasattr(receiver, 'func_code'):
+ return receiver, receiver.func_code, 0
+ elif hasattr(receiver, '__call__'):
+ return function(receiver.__call__)
+ else:
raise ValueError('unknown reciever type %s %s'%(receiver, type(receiver)))
- return receiver, receiver.func_code, 0
def robustApply(receiver, *arguments, **named):
"""Call receiver with arguments and an appropriate subset of named
|