[Zope-Checkins] CVS: Zope/lib/python/DateTime - DateTime.py:1.85.12.4

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


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

Modified Files:
      Tag: Zope-2_7-branch
	DateTime.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/DateTime/DateTime.py 1.85.12.3 => 1.85.12.4 ===
--- Zope/lib/python/DateTime/DateTime.py:1.85.12.3	Tue Oct 21 09:42:20 2003
+++ Zope/lib/python/DateTime/DateTime.py	Tue Nov  4 17:10:49 2003
@@ -393,6 +393,8 @@
     '''gmtime with a safety zone.'''
     try:
         t_int = int(t)
+        if isinstance(t_int, long):
+            raise OverflowError # Python 2.3 fix: int can return a long!
         return  gmtime(t_int)
     except (IOError, OverflowError):
         raise 'TimeError', 'The time %f is beyond the range ' \
@@ -402,6 +404,8 @@
     '''localtime with a safety zone.'''
     try:
         t_int = int(t)
+        if isinstance(t_int, long):
+            raise OverflowError # Python 2.3 fix: int can return a long!
     except OverflowError:
         raise 'TimeError', 'The time %f is beyond the range ' \
               'of this Python implementation.' % float(t)




More information about the Zope-Checkins mailing list