summaryrefslogtreecommitdiff
path: root/Lib/uuid.py
diff options
context:
space:
mode:
authorZachary Ware <zachary.ware@gmail.com>2013-11-26 14:57:10 -0600
committerZachary Ware <zachary.ware@gmail.com>2013-11-26 14:57:10 -0600
commit99fb0513ddf8b0315ed717d08ced1fa28d144f05 (patch)
tree682abc19c49b58468f5168b70ddb120601eff164 /Lib/uuid.py
parenta6edea530bb9f3a9ff6234f443ea5d00428a7635 (diff)
parent56507c7862b6e2de189b6a942f394efb676cdb0b (diff)
downloadcpython-git-99fb0513ddf8b0315ed717d08ced1fa28d144f05.tar.gz
Merge heads
Diffstat (limited to 'Lib/uuid.py')
-rw-r--r--Lib/uuid.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/Lib/uuid.py b/Lib/uuid.py
index 9226fd4ebb..d5c3160fdf 100644
--- a/Lib/uuid.py
+++ b/Lib/uuid.py
@@ -327,8 +327,16 @@ def _find_mac(command, args, hw_identifiers, get_index):
words = line.lower().split()
for i in range(len(words)):
if words[i] in hw_identifiers:
- return int(
- words[get_index(i)].replace(':', ''), 16)
+ try:
+ return int(
+ words[get_index(i)].replace(':', ''), 16)
+ except (ValueError, IndexError):
+ # Virtual interfaces, such as those provided by
+ # VPNs, do not have a colon-delimited MAC address
+ # as expected, but a 16-byte HWAddr separated by
+ # dashes. These should be ignored in favor of a
+ # real MAC address
+ pass
except IOError:
continue
return None