mirror of
https://github.com/python/cpython.git
synced 2025-08-23 10:16:01 +00:00
gh-95174: Handle missing waitpid and gethostbyname in WASI (GH-95181)
(cherry picked from commit 8184f0fce3
)
Co-authored-by: Christian Heimes <christian@python.org>
This commit is contained in:
parent
22f06d6ce3
commit
00cda6b530
2 changed files with 19 additions and 6 deletions
|
@ -524,6 +524,8 @@ def _ip_getnode():
|
|||
def _arp_getnode():
|
||||
"""Get the hardware address on Unix by running arp."""
|
||||
import os, socket
|
||||
if not hasattr(socket, "gethostbyname"):
|
||||
return None
|
||||
try:
|
||||
ip_addr = socket.gethostbyname(socket.gethostname())
|
||||
except OSError:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue