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

Andreas Jung andreas at andreas-jung.com
Tue Oct 21 09:42:50 EDT 2003


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

Modified Files:
      Tag: Zope-2_7-branch
	DateTime.py 
Log Message:

     - Collector #951: DateTime(None) is equal to DateTime()



=== Zope/lib/python/DateTime/DateTime.py 1.85.12.2 => 1.85.12.3 ===
--- Zope/lib/python/DateTime/DateTime.py:1.85.12.2	Tue Oct 21 09:10:59 2003
+++ Zope/lib/python/DateTime/DateTime.py	Tue Oct 21 09:42:20 2003
@@ -475,9 +475,9 @@
         DateTimes may be created with from zero to seven arguments.
 
 
-          - If the function is called with no arguments, then the
-            current date/time is returned, represented in the
-            timezone of the local machine.
+          - If the function is called with no arguments or with None, 
+            then the current date/time is returned, represented in the
+            timezone of the local machine. 
 
           - If the function is invoked with a single string argument
             which is a recognized timezone name, an object representing
@@ -632,16 +632,14 @@
         ac=len(args)
         millisecs = None
 
-        if ac and args[0]==None: 
-            raise self.SyntaxError, None
-        elif ac==10:
+        if ac==10:
             # Internal format called only by DateTime
             yr,mo,dy,hr,mn,sc,tz,t,d,s=args                  
         elif ac == 11:
             # Internal format that includes milliseconds.
             yr,mo,dy,hr,mn,sc,tz,t,d,s,millisecs=args
 
-        elif not args:
+        elif not args or (ac and args[0]==None):
             # Current time, to be displayed in local timezone
             t = time()
             lt = safelocaltime(t)




More information about the Zope-Checkins mailing list