[Erp5-report] r18829 - /erp5/trunk/products/ERP5Type/Base.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Jan 22 17:18:31 CET 2008


Author: jerome
Date: Tue Jan 22 17:18:28 2008
New Revision: 18829

URL: http://svn.erp5.org?rev=18829&view=rev
Log:
casting to int can raise both TypeError or ValueError depending on the type of
the provided value, so it's better to catch both for consistency.
Thx Kazuhiko !

Modified:
    erp5/trunk/products/ERP5Type/Base.py

Modified: erp5/trunk/products/ERP5Type/Base.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Base.py?rev=18829&r1=18828&r2=18829&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Base.py (original)
+++ erp5/trunk/products/ERP5Type/Base.py Tue Jan 22 17:18:28 2008
@@ -2447,7 +2447,7 @@
   def getIntId(self):
     try:
       return int(self.getId())
-    except ValueError:
+    except (ValueError, TypeError):
       return None
 
   # Default views - the default security in CMFCore




More information about the Erp5-report mailing list