mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'ci/fix_build_examples_v5.0' into 'release/v5.0'
ci(esp_prov): remove import future usage See merge request espressif/esp-idf!24924
This commit is contained in:
commit
bb2e88b27f
@ -6,14 +6,14 @@ from __future__ import print_function
|
||||
|
||||
import socket
|
||||
|
||||
from future.utils import tobytes
|
||||
|
||||
try:
|
||||
from http.client import HTTPConnection, HTTPSConnection
|
||||
except ImportError:
|
||||
# Python 2 fallback
|
||||
from httplib import HTTPConnection, HTTPSConnection # type: ignore
|
||||
|
||||
from utils import str_to_bytes
|
||||
|
||||
from .transport import Transport
|
||||
|
||||
|
||||
@ -36,8 +36,9 @@ class Transport_HTTP(Transport):
|
||||
self.headers = {'Content-type': 'application/x-www-form-urlencoded','Accept': 'text/plain'}
|
||||
|
||||
def _send_post_request(self, path, data):
|
||||
data = str_to_bytes(data) if isinstance(data, str) else data
|
||||
try:
|
||||
self.conn.request('POST', path, tobytes(data), self.headers)
|
||||
self.conn.request('POST', path, data, self.headers)
|
||||
response = self.conn.getresponse()
|
||||
if response.status == 200:
|
||||
return response.read().decode('latin-1')
|
||||
|
Loading…
Reference in New Issue
Block a user