Currently, sqlobject fails to install properly using pypy due to
robustapply.function failing to do the right thing. This issue was
previously reported against django's included version of pydispatcher
- see https://code.djangoproject.com/ticket/6857 .

Attached is the pypy patch from that ticket tweaked to apply against
sqlobject's included version of pydispatcher - this allows sqlobject
to install using pypy, although I still need to look at running the
test suite.

I've also reported to pydispatcher.sf.net, but the lack of recent
activity suggests it may be some time before it gets fixed there.

-- 
Neil Muller
drnlmul...@gmail.com

I've got a gmail account. Why haven't I become cool?
Index: sqlobject/include/pydispatch/robustapply.py
===================================================================
--- sqlobject/include/pydispatch/robustapply.py	(revision 4418)
+++ sqlobject/include/pydispatch/robustapply.py	(working copy)
@@ -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
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to