You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by je...@apache.org on 2011/01/04 04:17:03 UTC

svn commit: r1054880 - /incubator/libcloud/trunk/test/test_gogrid.py

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(".", "_"))