mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
[3.11] gh-96320: WASI socket fixes (GH-96388) (GH-#96748)
- ignore missing functions in ``socket.__repr__`` - bundle network files with assets
This commit is contained in:
parent
14adf4667e
commit
390123b412
3 changed files with 7 additions and 3 deletions
|
@ -254,17 +254,18 @@ class socket(_socket.socket):
|
|||
self.type,
|
||||
self.proto)
|
||||
if not closed:
|
||||
# getsockname and getpeername may not be available on WASI.
|
||||
try:
|
||||
laddr = self.getsockname()
|
||||
if laddr:
|
||||
s += ", laddr=%s" % str(laddr)
|
||||
except error:
|
||||
except (error, AttributeError):
|
||||
pass
|
||||
try:
|
||||
raddr = self.getpeername()
|
||||
if raddr:
|
||||
s += ", raddr=%s" % str(raddr)
|
||||
except error:
|
||||
except (error, AttributeError):
|
||||
pass
|
||||
s += '>'
|
||||
return s
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
Work around missing socket functions in :class:`~socket.socket`'s
|
||||
``__repr__``.
|
|
@ -229,7 +229,8 @@ def main():
|
|||
|
||||
extmods = detect_extension_modules(args)
|
||||
omit_files = list(OMIT_FILES)
|
||||
omit_files.extend(OMIT_NETWORKING_FILES)
|
||||
if sysconfig.get_platform().startswith("emscripten"):
|
||||
omit_files.extend(OMIT_NETWORKING_FILES)
|
||||
for modname, modfiles in OMIT_MODULE_FILES.items():
|
||||
if not extmods.get(modname):
|
||||
omit_files.extend(modfiles)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue