Hello,
I am getting error when using the following construct (which runs fine on pc python):
socket.socket(with socket.AF_INET, socket.SOCK_STREAM) as s:
The error says:
AttributeError: 'socket' object has no attribute '__exit__'
/a-ha
Getting error when using 'with' on socket
Re: Getting error when using 'with' on socket
I assume that's supposed to read:
It appears that this isn't supported in MicroPython (on any of the ports that support sockets), but it certainly does seem like a useful thing to support (and at a fairly low implementation cost).
Raised an issue at https://github.com/micropython/micropython/issues/6227
Code: Select all
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
Raised an issue at https://github.com/micropython/micropython/issues/6227
Re: Getting error when using 'with' on socket
Thanks for raising the issue! I appreciated this.