libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From je...@apache.org
Subject svn commit: r1054880 - /incubator/libcloud/trunk/test/test_gogrid.py
Date Tue, 04 Jan 2011 03:17:03 GMT
Author: jerry
Date: Tue Jan  4 03:17:03 2011
New Revision: 1054880

URL: http://svn.apache.org/viewvc?rev=1054880&view=rev
Log:
Fallback for urlparse.parse_qs to use (now deprecated) cgi.parse_qs in < 2.6

Modified:
    incubator/libcloud/trunk/test/test_gogrid.py

Modified: incubator/libcloud/trunk/test/test_gogrid.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/test_gogrid.py?rev=1054880&r1=1054879&r2=1054880&view=diff
==============================================================================
--- incubator/libcloud/trunk/test/test_gogrid.py (original)
+++ incubator/libcloud/trunk/test/test_gogrid.py Tue Jan  4 03:17:03 2011
@@ -175,8 +175,12 @@ class GoGridMockHttp(MockHttp):
     def _api_common_lookup_list(self, method, url, body, headers):
         _valid_lookups = ("ip.datacenter",)
 
-        lookup = urlparse.parse_qs(
-                    urlparse.urlparse(url).query)["lookup"][0]
+        try:
+            from urlparse import parse_qs
+        except ImportError:
+            from cgi import parse_qs
+
+        lookup = parse_qs(urlparse.urlparse(url).query)["lookup"][0]
         if lookup in _valid_lookups:
             fixture_path = "lookup_list_%s.json" % \
                     (lookup.replace(".", "_"))



Mime
View raw message