All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] The method union_update on a set was renamed to update in Python 2.3
@ 2009-04-18 17:02 Ruben Kerkhof
  0 siblings, 0 replies; only message in thread
From: Ruben Kerkhof @ 2009-04-18 17:02 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 880 bytes --]

# HG changeset patch
# User Ruben Kerkhof <ruben@rubenkerkhof.com>
# Date 1240073704 -7200
# Node ID 818a59a91d5b75246a448fdd6b6de6542e159b75
# Parent  655dc3bc1d8ee15465f9ce14a1dc23f1f01c639a
The method union_update on a set was renamed to update in Python 2.3

diff -r 655dc3bc1d8e -r 818a59a91d5b tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py	Thu Apr 16 11:54:06 2009 +0100
+++ b/tools/python/xen/xend/XendAPI.py	Sat Apr 18 18:55:04 2009 +0200
@@ -125,7 +125,11 @@
             }
     if not reg_classes:
         reg_classes = classes
-    event_registrations[session]['classes'].union_update(reg_classes)
+    if hasattr(set, 'union_update'):
+        event_registrations[session]['classes'].union_update(reg_classes)
+    else:
+        event_registrations[session]['classes'].update(reg_classes)
+


 def event_unregister(session, unreg_classes):

[-- Attachment #2: XendAPI-union-update.patch --]
[-- Type: application/octet-stream, Size: 882 bytes --]

# HG changeset patch
# User Ruben Kerkhof <ruben@rubenkerkhof.com>
# Date 1240073704 -7200
# Node ID 818a59a91d5b75246a448fdd6b6de6542e159b75
# Parent  655dc3bc1d8ee15465f9ce14a1dc23f1f01c639a
The method union_update on a set was renamed to update in Python 2.3

diff -r 655dc3bc1d8e -r 818a59a91d5b tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py	Thu Apr 16 11:54:06 2009 +0100
+++ b/tools/python/xen/xend/XendAPI.py	Sat Apr 18 18:55:04 2009 +0200
@@ -125,7 +125,11 @@
             }
     if not reg_classes:
         reg_classes = classes
-    event_registrations[session]['classes'].union_update(reg_classes)
+    if hasattr(set, 'union_update'):
+        event_registrations[session]['classes'].union_update(reg_classes)
+    else:
+        event_registrations[session]['classes'].update(reg_classes)
+
 
 
 def event_unregister(session, unreg_classes):

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-04-18 17:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-18 17:02 [PATCH] The method union_update on a set was renamed to update in Python 2.3 Ruben Kerkhof

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.