mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
Fix TypeError with datetime() on old python version
signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
This commit is contained in:
1 parent
6ba4666914
commit
e52527b9ed
1 file changed
+4
-1
@@ -96,7 +96,10 @@ def datetime(when = None):
|
||||
@param when The time in question, given as seconds since the epoch, UTC.
|
||||
May be None, in which case the current time is used.
|
||||
"""
|
||||
return xmlrpclib.DateTime(time.gmtime(when))
|
||||
if when is None:
|
||||
return xmlrpclib.DateTime(time.gmtime())
|
||||
else:
|
||||
return xmlrpclib.DateTime(time.gmtime(when))
|
||||
|
||||
|
||||
# ---------------------------------------------------
|
||||
|
||||