Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 202267 Details for
Bug 282729
app-emulation/xen-tools - DeprecationWarnings with python 2.6
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
xen-tools-3.3.1-python.patch
xen-tools-3.3.1-python.patch (text/plain), 2.55 KB, created by
Marcel Pennewiß
on 2009-08-25 18:49:00 UTC
(
hide
)
Description:
xen-tools-3.3.1-python.patch
Filename:
MIME Type:
Creator:
Marcel Pennewiß
Created:
2009-08-25 18:49:00 UTC
Size:
2.55 KB
patch
obsolete
># Source: http://lists.xensource.com/archives/html/xen-devel/2009-05/msg00477.html ># modified-by: Marcel Pennewiss <gentoo@pennewiss.de> >Avoid DeprecationWarnings in python 2.6. >Use hashlib.sha1 instead of sha.sha, and set instead of sets.Set. >If import fails (as it will on older pythons), fall back to the >old types. > >diff -r 2522cc95efd2 -r 45498072e34c tools/python/xen/util/acmpolicy.py >--- a/tools/python/xen/util/acmpolicy.py Mon May 11 13:52:04 2009 +0100 >+++ b/tools/python/xen/util/acmpolicy.py Tue May 12 14:43:52 2009 -0700 >@@ -17,12 +17,19 @@ > #============================================================================ > > import os >-import sha > import stat > import array > import struct > import shutil > import commands >+ >+# sha is deprecated as of python 2.6 >+try: >+ from hashlib import sha1 >+except ImportError: >+ # but hashlib was only added in python 2.5 >+ from sha import new as sha1 >+ > from xml.dom import minidom, Node > from xen.xend.XendLogging import log > from xen.util import xsconstants, bootloader, mkdir >@@ -1102,8 +1109,8 @@ > return None > > def hash(self): >- """ Calculate a SAH1 hash of the XML policy """ >- return sha.sha(self.toxml()) >+ """ Calculate a SHA1 hash of the XML policy """ >+ return sha1(self.toxml()) > > def save(self): > ### Save the XML policy into a file ### >diff -r 2522cc95efd2 -r 45498072e34c tools/python/xen/xend/XendAPI.py >--- a/tools/python/xen/xend/XendAPI.py Mon May 11 13:52:04 2009 +0100 >+++ b/tools/python/xen/xend/XendAPI.py Tue May 12 14:43:52 2009 -0700 >@ -18,7 +18,6 @@ > import inspect > import os > import Queue >-import sets > import string > import sys > import traceback >@@ -25,6 +24,12 @@ > import time > import xmlrpclib > >+# sets is deprecated as of python 2.6, but set is unavailable in 2.3 >+try: >+ set >+except NameError: >+ from sets import Set as set >+ > import XendDomain, XendDomainInfo, XendNode, XendDmesg > import XendLogging, XendTaskManager, XendAPIStore > >@@ -115,13 +120,14 @@ > 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 > } > if not reg_classes: > reg_classes = classes >- event_registrations[session]['classes'].union_update(reg_classes) >+ sessionclasses = event_registrations[session]['classes'] >+ sessionclasses.union_update(reg_classes) > > > def event_unregister(session, unreg_classes):
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 282729
:
202264
|
202266
| 202267 |
202268