mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
gh-95174: Handle missing waitpid and gethostbyname in WASI (GH-95181)
This commit is contained in:
parent
5c7f3bcdaf
commit
8184f0fce3
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