[Erp5-report] r14975 - /erp5/trunk/products/ERP5/Document/Predicate.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Jun 26 12:13:38 CEST 2007
Author: aurel
Date: Tue Jun 26 12:13:38 2007
New Revision: 14975
URL: http://svn.erp5.org?rev=14975&view=rev
Log:
add compatibility with script that takes no argument
Modified:
erp5/trunk/products/ERP5/Document/Predicate.py
Modified: erp5/trunk/products/ERP5/Document/Predicate.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Predicate.py?rev=14975&r1=14974&r2=14975&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Predicate.py (original)
+++ erp5/trunk/products/ERP5/Document/Predicate.py Tue Jun 26 12:13:38 2007
@@ -162,7 +162,11 @@
for test_method_id in test_method_id_list :
if (test_method_id is not None) and result:
method = getattr(context,test_method_id)
- result = result and method(self)
+ try:
+ result = result and method(self)
+ except TypeError:
+ # backward compatibilty with script that takes no argument
+ result = result and method()
# LOG('predicate test', 0,
# '%s after method %s ' % (result, test_method_id))
return result
More information about the Erp5-report
mailing list