Made DateTime's constructor accept a time.struct_time class,

besides plain tuples.
This commit is contained in:
Gustavo Niemeyer 2003-06-16 02:49:42 +00:00
parent f545baa0cc
commit d5b8090e4c

View file

@ -343,7 +343,7 @@ class DateTime:
def __init__(self, value=0):
if not isinstance(value, StringType):
if not isinstance(value, TupleType):
if not isinstance(value, (TupleType, time.struct_time)):
if value == 0:
value = time.time()
value = time.localtime(value)