[Zope-Checkins] CVS: Zope2 - DateTime.py:1.68.2.1

andreas@serenade.digicool.com andreas@serenade.digicool.com
Thu, 5 Jul 2001 11:56:00 -0400


Update of /cvs-repository/Zope2/lib/python/DateTime
In directory serenade:/tmp/cvs-serv28655/lib/python/DateTime

Modified Files:
      Tag: Zope-2_4-branch
	DateTime.py 
Log Message:
Collector # 2375: DateTime constructor was unable to handle unicode
strings.
          



--- Updated File DateTime.py in package Zope2 --
--- DateTime.py	2001/06/15 17:51:56	1.68
+++ DateTime.py	2001/07/05 15:55:29	1.68.2.1
@@ -92,7 +92,7 @@
 from time import time, gmtime, localtime, asctime
 from time import timezone, strftime, mktime
 from time import daylight, timezone, altzone
-from types import InstanceType,IntType,FloatType,StringType
+from types import InstanceType,IntType,FloatType,StringType,UnicodeType
 try: from time import tzname
 except: tzname=('UNKNOWN','UNKNOWN')
 
@@ -700,7 +700,7 @@
             if arg=='':
                 raise self.SyntaxError, arg
             
-            if type(arg)==StringType and lower(arg) in self._tzinfo._zidx:
+            if type(arg) in [StringType,UnicodeType] and lower(arg) in self._tzinfo._zidx:
                 # Current time, to be displayed in specified timezone
                 t,tz=time(),self._tzinfo._zmap[lower(arg)]
                 ms=(t-math.floor(t))
@@ -709,7 +709,7 @@
                 x = _calcDependentSecond(tz, t)
                 yr,mo,dy,hr,mn,sc = _calcYMDHMS(x, ms)
 
-            elif type(arg)==StringType:
+            elif type(arg) in [StringType,UnicodeType]:
                 # Date/time string
                
                 if arg.find(' ')==-1 and arg[4]=='-':