瀏覽代碼

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

Alois Mahdal 2 年之前
父節點
當前提交
eff1b63f9e
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      doc/examples/example_test.py

+ 2
- 2
doc/examples/example_test.py 查看文件

@@ -4,7 +4,7 @@ import http.client
4 4
 import operator
5 5
 import subprocess
6 6
 import unittest
7
-import urlparse
7
+import urllib.parse
8 8
 
9 9
 from sznqalibs import hoover
10 10
 
@@ -46,7 +46,7 @@ class CgiCalcDriver(BaseCalcDriver):
46 46
 
47 47
     def _get_data(self):
48 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 50
         conn = http.client.HTTPConnection(parsed_url.hostname)
51 51
         conn.request("GET", "%s?%s" % (parsed_url.path, pq))
52 52
         resp = conn.getresponse()