Commit f76cb714 authored by Andreas Jung's avatar Andreas Jung

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

parent d980b46d
...@@ -16,7 +16,7 @@ Zope Changes ...@@ -16,7 +16,7 @@ Zope Changes
Bugs fixed Bugs fixed
- Collector #951: DateTime(None) now raises a proper SyntaxError - Collector #951: DateTime(None) is equal to DateTime()
- Collector #1056: aq_acquire() ignored the default argument - Collector #1056: aq_acquire() ignored the default argument
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
############################################################################## ##############################################################################
"""Encapsulation of date/time values""" """Encapsulation of date/time values"""
__version__='$Revision: 1.87 $'[11:-2] __version__='$Revision: 1.88 $'[11:-2]
import os, re, math, DateTimeZone import os, re, math, DateTimeZone
...@@ -632,16 +632,14 @@ class DateTime: ...@@ -632,16 +632,14 @@ class DateTime:
ac=len(args) ac=len(args)
millisecs = None millisecs = None
if ac and args[0]==None: if ac==10:
raise self.SyntaxError, None
elif ac==10:
# Internal format called only by DateTime # Internal format called only by DateTime
yr,mo,dy,hr,mn,sc,tz,t,d,s=args yr,mo,dy,hr,mn,sc,tz,t,d,s=args
elif ac == 11: elif ac == 11:
# Internal format that includes milliseconds. # Internal format that includes milliseconds.
yr,mo,dy,hr,mn,sc,tz,t,d,s,millisecs=args 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 # Current time, to be displayed in local timezone
t = time() t = time()
lt = safelocaltime(t) lt = safelocaltime(t)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment