Sfoglia il codice sorgente

Convert to Python 3: `httplib` -> `http.client`

Alois Mahdal 2 anni fa
parent
commit
3448ed09a3
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2
    2
      doc/examples/example_test.py

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

@@ -1,6 +1,6 @@
1 1
 #!/usr/bin/python
2 2
 
3
-import httplib
3
+import http.client
4 4
 import operator
5 5
 import subprocess
6 6
 import unittest
@@ -47,7 +47,7 @@ class CgiCalcDriver(BaseCalcDriver):
47 47
     def _get_data(self):
48 48
         pq = "op=%(op)s&a=%(a)s&b=%(b)s" % self._args
49 49
         parsed_url = urlparse.urlparse(self._settings['uri'])
50
-        conn = httplib.HTTPConnection(parsed_url.hostname)
50
+        conn = http.client.HTTPConnection(parsed_url.hostname)
51 51
         conn.request("GET", "%s?%s" % (parsed_url.path, pq))
52 52
         resp = conn.getresponse()
53 53
         assert resp.status == 200