Skip to content

Commit ff27e3c

Browse files
mbueschpfalcon
authored andcommitted
socket: Add socket.error
Older CPython versions raised socker.error (or classes derived from it) as exceptions on errors. Various software still uses it to be compatible with older Python versions. As it's one-line fix, allow MicroPython to run such code too. try: socket... except socker.error as e: ...
1 parent 17d96d3 commit ff27e3c

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

socket/metadata.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
srctype = micropython-lib
22
type = module
3-
version = 0.3.2
3+
version = 0.3.3
44
author = Paul Sokolovsky

socket/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
setup(name='micropython-socket',
9-
version='0.3.2',
9+
version='0.3.3',
1010
description='socket module for MicroPython',
1111
long_description="This is a module reimplemented specifically for MicroPython standard library,\nwith efficient and lean design in mind. Note that this module is likely work\nin progress and likely supports just a subset of CPython's corresponding\nmodule. Please help with the development if you are interested in this\nmodule.",
1212
url='https://github.com/micropython/micropython/issues/405',

socket/socket.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
IP_ADD_MEMBERSHIP = 35
88
IP_DROP_MEMBERSHIP = 36
99

10+
error = OSError
11+
1012
def _resolve_addr(addr):
1113
if isinstance(addr, (bytes, bytearray)):
1214
return addr

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy