WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Fix TypeError with datetime() on old pyth

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Fix TypeError with datetime() on old python version
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 13 Apr 2007 10:50:34 -0700
Delivery-date: Fri, 13 Apr 2007 11:22:36 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Tom Wilkie <tom.wilkie@xxxxxxxxx>
# Date 1176476561 -3600
# Node ID 0ab8f81019a5df4250893f1aae2d64969b4d1c18
# Parent  22460cfaca71788d78a7f610706f78e28aea438c
Fix TypeError with datetime() on old python version

signed-off-by: Tom Wilkie <tom.wilkie@xxxxxxxxx>
---
 tools/python/xen/xend/XendAPI.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)

diff -r 22460cfaca71 -r 0ab8f81019a5 tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py  Fri Apr 13 15:24:42 2007 +0100
+++ b/tools/python/xen/xend/XendAPI.py  Fri Apr 13 16:02:41 2007 +0100
@@ -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))
 
 
 # ---------------------------------------------------

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Fix TypeError with datetime() on old python version, Xen patchbot-unstable <=