From: Serhiy Storchaka Date: Fri, 21 Nov 2014 19:56:57 +0000 (+0200) Subject: Issue #19720: Suppressed context for some exceptions in importlib. X-Git-Tag: v3.5.0a1~462 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fc9fdedd09c42a3f49b0ea8f6b22d3f2872af186;p=thirdparty%2FPython%2Fcpython.git Issue #19720: Suppressed context for some exceptions in importlib. --- fc9fdedd09c42a3f49b0ea8f6b22d3f2872af186 diff --cc Lib/uuid.py index 598aea1956ab,1061bffc43c7..9c2a971ae529 --- a/Lib/uuid.py +++ b/Lib/uuid.py @@@ -359,10 -361,13 +359,13 @@@ 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', [ip_addr], lambda i: -1) + return _find_mac('arp', '-an', [os.fsencode(ip_addr)], lambda i: -1) def _lanscan_getnode(): """Get the hardware address on Unix by running lanscan."""