cpython: 8a61a287776d (original) (raw)
Mercurial > cpython
changeset 92370:8a61a287776d 3.4
Issue #22131: Fixed a bug in handling an error occured during reading from a pipe in _ipconfig_getnode(). [#22131]
Serhiy Storchaka storchaka@gmail.com | |
---|---|
date | Sat, 06 Sep 2014 22:17:24 +0300 |
parents | c1fb19907cc4 |
children | 1f365cea77b8 f89995a4ec11 |
files | Lib/uuid.py |
diffstat | 1 files changed, 1 insertions(+), 3 deletions(-)[+] [-] Lib/uuid.py 4 |
line wrap: on
line diff
--- a/Lib/uuid.py +++ b/Lib/uuid.py @@ -383,13 +383,11 @@ def _ipconfig_getnode(): pipe = os.popen(os.path.join(dir, 'ipconfig') + ' /all') except OSError: continue
else:[](#l1.7)
with pipe:[](#l1.8) for line in pipe:[](#l1.9) value = line.split(':')[-1].strip().lower()[](#l1.10) if re.match('([0-9a-f][0-9a-f]-){5}[0-9a-f][0-9a-f]', value):[](#l1.11) return int(value.replace('-', ''), 16)[](#l1.12)
finally:[](#l1.13)
pipe.close()[](#l1.14)
def _netbios_getnode(): """Get the hardware address on Windows using NetBIOS calls.