Browse Source

Convert to Python 3: `urlparse` -> `urllib.parse`

Alois Mahdal 2 years ago
parent
commit
eff1b63f9e
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      doc/examples/example_test.py

+ 2
- 2
doc/examples/example_test.py View File

4
 import operator
4
 import operator
5
 import subprocess
5
 import subprocess
6
 import unittest
6
 import unittest
7
-import urlparse
7
+import urllib.parse
8
 
8
 
9
 from sznqalibs import hoover
9
 from sznqalibs import hoover
10
 
10
 
46
 
46
 
47
     def _get_data(self):
47
     def _get_data(self):
48
         pq = "op=%(op)s&a=%(a)s&b=%(b)s" % self._args
48
         pq = "op=%(op)s&a=%(a)s&b=%(b)s" % self._args
49
-        parsed_url = urlparse.urlparse(self._settings['uri'])
49
+        parsed_url = urllib.parse.urlparse(self._settings['uri'])
50
         conn = http.client.HTTPConnection(parsed_url.hostname)
50
         conn = http.client.HTTPConnection(parsed_url.hostname)
51
         conn.request("GET", "%s?%s" % (parsed_url.path, pq))
51
         conn.request("GET", "%s?%s" % (parsed_url.path, pq))
52
         resp = conn.getresponse()
52
         resp = conn.getresponse()