[py3k] get urllib foo from six.moves
authorJulien Cristau <julien.cristau@logilab.fr>
Thu, 01 Oct 2015 12:32:27 +0200
changeset 10756 3eb527ce5f0f
parent 10755 4c48d3bab38c
child 10757 f73a9a884534
[py3k] get urllib foo from six.moves
sobjects/cwxmlparser.py
--- a/sobjects/cwxmlparser.py	Thu Oct 01 12:15:14 2015 +0200
+++ b/sobjects/cwxmlparser.py	Thu Oct 01 12:32:27 2015 +0200
@@ -35,7 +35,7 @@
 import urllib
 
 from six import text_type
-from six.moves.urllib.parse import urlparse, urlunparse, parse_qs
+from six.moves.urllib.parse import urlparse, urlunparse, parse_qs, urlencode
 
 from logilab.common.date import todate, totime
 from logilab.common.textutils import splitstrip, text_to_dict
@@ -250,8 +250,8 @@
             if 'vid' not in params:
                 params['vid'] = ['xml']
                 purl = list(purl)
-                purl[4] = urllib.urlencode(params, doseq=True)
-                return urlparse.urlunparse(purl)
+                purl[4] = urlencode(params, doseq=True)
+                return urlunparse(purl)
         return url
 
     def complete_url(self, url, etype=None, known_relations=None):
@@ -279,7 +279,7 @@
                 continue
             relations.add('%s-%s' % (rtype, role))
         purl = list(purl)
-        purl[4] = urllib.urlencode(params, doseq=True)
+        purl[4] = urlencode(params, doseq=True)
         return urlunparse(purl)
 
     def complete_item(self, item, rels):