Fix TypeError with datetime() on old python version

signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
This commit is contained in:
Tom Wilkie committed 2007-04-13 16:02:41 +01:00
1 parent 6ba4666914
commit e52527b9ed
1 file changed
+4 -1
+4 -1
View File
@@ -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))
# ---------------------------------------------------
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.