mirror of
https://github.com/python/cpython.git
synced 2025-09-03 07:28:59 +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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue