gh-95174: Handle missing waitpid and gethostbyname in WASI (GH-95181)

This commit is contained in:
Christian Heimes 2022-07-24 08:04:06 +02:00 committed by GitHub
parent 5c7f3bcdaf
commit 8184f0fce3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 6 deletions

View file

@ -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: