← Back to team overview

txaws-dev team mailing list archive

[Merge] lp:~jkakar/txaws/silence-deprecation-warnings into lp:txaws

 

Jamu Kakar has proposed merging lp:~jkakar/txaws/silence-deprecation-warnings into lp:txaws.

Requested reviews:
  txAWS Developers (txaws-dev)
Related bugs:
  Bug #768311 in txAWS: "txaws deprecation warnings from elementree with ensemble usage"
  https://bugs.launchpad.net/txaws/+bug/768311

For more details, see:
https://code.launchpad.net/~jkakar/txaws/silence-deprecation-warnings/+merge/58664

This branch introduces the following changes:

- Minor changes have been made to silence deprecation warnings
  generated by the test suite when run with Python 2.7.

-- 
https://code.launchpad.net/~jkakar/txaws/silence-deprecation-warnings/+merge/58664
Your team txAWS Developers is requested to review the proposed merge of lp:~jkakar/txaws/silence-deprecation-warnings into lp:txaws.
=== modified file 'txaws/ec2/client.py'
--- txaws/ec2/client.py	2011-04-19 17:42:18 +0000
+++ txaws/ec2/client.py	2011-04-21 13:12:28 +0000
@@ -76,7 +76,7 @@
             "availabilityZone")
         products = []
         product_codes = instance_data.find("productCodes")
-        if product_codes:
+        if product_codes is not None:
             for product_data in instance_data.find("productCodes"):
                 products.append(product_data.text)
         kernel_id = instance_data.findtext("kernelId")
@@ -236,7 +236,9 @@
             owner_id = group_info.findtext("ownerId")
             allowed_groups = []
             allowed_ips = []
-            ip_permissions = group_info.find("ipPermissions") or ()
+            ip_permissions = group_info.find("ipPermissions")
+            if ip_permissions is None:
+                ip_permissions = ()
             for ip_permission in ip_permissions:
                 ip_protocol = ip_permission.findtext("ipProtocol")
                 from_port = int(ip_permission.findtext("fromPort"))
@@ -630,7 +632,7 @@
         results = []
         root = XML(xml_bytes)
         keypairs = root.find("keySet")
-        if not keypairs:
+        if keypairs is None:
             return results
         for keypair_data in keypairs:
             key_name = keypair_data.findtext("keyName")

=== modified file 'txaws/ec2/exception.py'
--- txaws/ec2/exception.py	2009-11-22 05:15:21 +0000
+++ txaws/ec2/exception.py	2011-04-21 13:12:28 +0000
@@ -10,7 +10,7 @@
     """
     def _set_400_error(self, tree):
         errors_node = tree.find(".//Errors")
-        if errors_node:
+        if errors_node is not None:
             for error in errors_node:
                 data = self._node_to_dict(error)
                 if data: