Skip to contentSkip to conversation

The method union_update on a set was renamed to update in Python 2.3

PATCH New Ruben Kerkhof 1 participant 1 message Apr 18, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 The method union_update on a set was renamed to update in Python 2.3

# HG changeset patch
# User Ruben Kerkhof <[email protected]>
# Date 1240073704 -7200
# Node ID 818a59a91d5b75246a448fdd6b6de6542e159b75
# Parent 655dc3bc1d8ee15465f9ce14a1dc23f1f01c639a
The method union_update on a set was renamed to update in Python 2.3

tools/python/xen/xend/XendAPI.py +5 -1
diff -r 655dc3bc1d8e -r 818a59a91d5b tools/python/xen/xend/XendAPI.py
@@ -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):

# HG changeset patch
# User Ruben Kerkhof <[email protected]>
# Date 1240073704 -7200
# Node ID 818a59a91d5b75246a448fdd6b6de6542e159b75
# Parent 655dc3bc1d8ee15465f9ce14a1dc23f1f01c639a
The method union_update on a set was renamed to update in Python 2.3

tools/python/xen/xend/XendAPI.py +5 -1
diff -r 655dc3bc1d8e -r 818a59a91d5b tools/python/xen/xend/XendAPI.py
@@ -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):

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel