]> granicus.if.org Git - python/commitdiff
Issue #19720: Suppressed context for some exceptions in importlib.
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 21 Nov 2014 19:56:57 +0000 (21:56 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Fri, 21 Nov 2014 19:56:57 +0000 (21:56 +0200)
1  2 
Lib/uuid.py

diff --cc Lib/uuid.py
index 598aea1956ab1efce563b16797497771eacb6f71,1061bffc43c7184f4d280b9c5d4b2d557190811b..9c2a971ae5299eac277b8a7778e91483beecc83e
@@@ -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."""