kopia lustrzana https://github.com/micropython/micropython-lib
http.client: Test string by type, not by presense of some method.
MicroPython has both encode() & decode() for both str & bytes, and it's expensive to have it otherwise.pull/118/head
rodzic
34644d566e
commit
886587bd72
|
@ -1038,7 +1038,7 @@ class HTTPConnection:
|
|||
header = header.encode('ascii')
|
||||
values = list(values)
|
||||
for i, one_value in enumerate(values):
|
||||
if hasattr(one_value, 'encode'):
|
||||
if isinstance(one_value, str):
|
||||
values[i] = one_value.encode('latin-1')
|
||||
elif isinstance(one_value, int):
|
||||
values[i] = str(one_value).encode('ascii')
|
||||
|
|
Ładowanie…
Reference in New Issue