diff options
| author | Zachary Ware <zachary.ware@gmail.com> | 2013-11-26 20:57:45 (GMT) |
|---|---|---|
| committer | Zachary Ware <zachary.ware@gmail.com> | 2013-11-26 20:57:45 (GMT) |
| commit | 910b1c39931dd40a2aeddff101bb74f5f952b4bf (patch) | |
| tree | b69f22a1391cd8abc717cae42a378e82f865797d /Lib/uuid.py | |
| parent | 29f8cb64e64cbbb3e5da7b280b78d37b58719070 (diff) | |
| parent | 822963ed5d6150f901979fe9d61ef9026e4787a5 (diff) | |
| download | cpython-910b1c39931dd40a2aeddff101bb74f5f952b4bf.zip cpython-910b1c39931dd40a2aeddff101bb74f5f952b4bf.tar.gz cpython-910b1c39931dd40a2aeddff101bb74f5f952b4bf.tar.bz2 | |
Merge heads
Diffstat (limited to 'Lib/uuid.py')
| -rw-r--r-- | Lib/uuid.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Lib/uuid.py b/Lib/uuid.py index 93254ec..385fb9b 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 OSError: continue return None |
