[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/DateIndex - DateIndex.py:1.13

Chris McDonough cvs-admin at zope.org
Tue Nov 4 17:09:34 EST 2003


Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/DateIndex
In directory cvs.zope.org:/tmp/cvs-serv26822

Modified Files:
	DateIndex.py 
Log Message:
Deal with the fact that in Python 2.3, int can return a long instead of
throwing OverflowError.


=== Zope/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py 1.12 => 1.13 ===
--- Zope/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py:1.12	Tue Jun 17 15:01:06 2003
+++ Zope/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py	Tue Nov  4 17:09:03 2003
@@ -190,13 +190,13 @@
 
         t_val = ( ( ( ( yr * 12 + mo ) * 31 + dy ) * 24 + hr ) * 60 + mn )
 
-        try:
+        if isinstance(t_val, long):
             # t_val must be IntType, not LongType
-            return int(t_val)
-        except OverflowError:
             raise OverflowError, (
                 "%s is not within the range of indexable dates (index: %s)"
                 % (value, self.id))
+
+        return t_val
 
 
 manage_addDateIndexForm = DTMLFile( 'dtml/addDateIndex', globals() )




More information about the Zope-Checkins mailing list