[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/DateRangeIndex - DateRangeIndex.py:1.6.2.4

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


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

Modified Files:
      Tag: Zope-2_7-branch
	DateRangeIndex.py 
Log Message:
Deal with the fact that in Python 2.3, int can return a long instead
of throwing an OverflowError on numbers > sys.maxint.


=== Zope/lib/python/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py 1.6.2.3 => 1.6.2.4 ===
--- Zope/lib/python/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py:1.6.2.3	Tue Nov  4 10:01:17 2003
+++ Zope/lib/python/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py	Tue Nov  4 17:10:50 2003
@@ -406,8 +406,8 @@
         if isinstance( value, DateTime ):
             value = value.millis() / 1000 / 60 # flatten to minutes
         result = int( value )
-        if isinstance(result, long): # this won't work
-            raise ValueError( '%s is not within the range of dates allowed'
+        if isinstance(result, long): # this won't work (Python 2.3)
+            raise OverflowError( '%s is not within the range of dates allowed'
                               'by a DateRangeIndex' % value)
         return result
 




More information about the Zope-Checkins mailing list