]> granicus.if.org Git - python/commitdiff
Made DateTime's constructor accept a time.struct_time class,
authorGustavo Niemeyer <gustavo@niemeyer.net>
Mon, 16 Jun 2003 02:49:42 +0000 (02:49 +0000)
committerGustavo Niemeyer <gustavo@niemeyer.net>
Mon, 16 Jun 2003 02:49:42 +0000 (02:49 +0000)
besides plain tuples.

Lib/xmlrpclib.py

index a3b9e703919fbc0400a65a7b2615e91c0c6d127b..a873f770fa19b17760513c85dea3e176ee2d0329 100644 (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)