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-devel

Re: [Xen-devel] [patch] fix python 2.6 warnings

To: Xen Development Mailing List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [patch] fix python 2.6 warnings
From: Gerd Hoffmann <kraxel@xxxxxxxxxx>
Date: Tue, 10 Mar 2009 13:16:41 +0100
Delivery-date: Tue, 10 Mar 2009 05:17:08 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <49B64EC3.4070303@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <49B64EC3.4070303@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.19 (X11/20090105)
Gerd Hoffmann wrote:
>   Hi,
> 
> Attached patch fixes a few python warnings about deprecated modules.

Oops, that one had a tyops, fixed version attached.

cheers,
  Gerd
diff -up xen-3.3.1/tools/python/xen/util/acmpolicy.py.deprecated 
xen-3.3.1/tools/python/xen/util/acmpolicy.py
--- xen-3.3.1/tools/python/xen/util/acmpolicy.py.deprecated     2009-03-09 
17:22:39.000000000 +0100
+++ xen-3.3.1/tools/python/xen/util/acmpolicy.py        2009-03-09 
17:23:09.000000000 +0100
@@ -17,7 +17,7 @@
 #============================================================================
 
 import os
-import sha
+import hashlib
 import stat
 import array
 import struct
@@ -1103,7 +1103,7 @@ class ACMPolicy(XSPolicy):
 
     def hash(self):
         """ Calculate a SAH1 hash of the XML policy """
-        return sha.sha(self.toxml())
+        return hashlib.sha1(self.toxml())
 
     def save(self):
         ### Save the XML policy into a file ###
diff -up xen-3.3.1/tools/python/xen/xend/XendAPI.py.deprecated 
xen-3.3.1/tools/python/xen/xend/XendAPI.py
--- xen-3.3.1/tools/python/xen/xend/XendAPI.py.deprecated       2009-03-10 
11:16:47.000000000 +0100
+++ xen-3.3.1/tools/python/xen/xend/XendAPI.py  2009-03-10 13:13:33.000000000 
+0100
@@ -18,7 +18,6 @@
 import inspect
 import os
 import Queue
-import sets
 import string
 import sys
 import traceback
@@ -116,7 +115,7 @@ event_registrations = {}
 def event_register(session, reg_classes):
     if session not in event_registrations:
         event_registrations[session] = {
-            'classes' : sets.Set(),
+            'classes' : set(),
             'queue'   : Queue.Queue(EVENT_QUEUE_LENGTH),
             'next-id' : 1
             }
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel