Skip to content

Commit 895bd41

Browse files
authored
Update urequests.py
Chunked detection does not work on current Micropython as it never has an `__iter__` attribute to a generator. It does add `__next__` to them, so this test in `urequests` for chunked detection did not work. I've changed it to `__next__`. I can post a failing example in the PR.
1 parent 7128d42 commit 895bd41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python-ecosys/urequests/urequests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def request(
4545
parse_headers=True,
4646
):
4747
redirect = None # redirection url, None means no redirection
48-
chunked_data = data and getattr(data, "__iter__", None) and not getattr(data, "__len__", None)
48+
chunked_data = data and getattr(data, "__next__", None) and not getattr(data, "__len__", None)
4949

5050
if auth is not None:
5151
import ubinascii

0 commit comments

Comments
 (0)