mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Made DateTime's constructor accept a time.struct_time class,
besides plain tuples.
This commit is contained in:
parent
f545baa0cc
commit
d5b8090e4c
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue