mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #19720: Suppressed context for some exceptions in importlib.
This commit is contained in:
commit
fc9fdedd09
1 changed files with 4 additions and 1 deletions
|
@ -359,7 +359,10 @@ def _ifconfig_getnode():
|
|||
def _arp_getnode():
|
||||
"""Get the hardware address on Unix by running arp."""
|
||||
import os, socket
|
||||
ip_addr = socket.gethostbyname(socket.gethostname())
|
||||
try:
|
||||
ip_addr = socket.gethostbyname(socket.gethostname())
|
||||
except OSError:
|
||||
return None
|
||||
|
||||
# Try getting the MAC addr from arp based on our IP address (Solaris).
|
||||
return _find_mac('arp', '-an', [os.fsencode(ip_addr)], lambda i: -1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue