summaryrefslogtreecommitdiffstats
path: root/Lib/uuid.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-11-21 19:56:57 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-11-21 19:56:57 (GMT)
commitfc9fdedd09c42a3f49b0ea8f6b22d3f2872af186 (patch)
tree667df888d333b4653e33f94f1d50ed6f92f0ac88 /Lib/uuid.py
parentc4464052d93de1d34721f673d9d4199428537ae7 (diff)
parent525d5aeaaef40ad254da57a93b35a07ecb2bdb0b (diff)
downloadcpython-fc9fdedd09c42a3f49b0ea8f6b22d3f2872af186.zip
cpython-fc9fdedd09c42a3f49b0ea8f6b22d3f2872af186.tar.gz
cpython-fc9fdedd09c42a3f49b0ea8f6b22d3f2872af186.tar.bz2
Issue #19720: Suppressed context for some exceptions in importlib.
Diffstat (limited to 'Lib/uuid.py')
-rw-r--r--Lib/uuid.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/uuid.py b/Lib/uuid.py
index 598aea1..9c2a971 100644
--- a/Lib/uuid.py
+++ b/Lib/uuid.py
@@ -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)