Kaydet (Commit) c70386ec authored tarafından Serhiy Storchaka's avatar Serhiy Storchaka

Issue #22131: Fixed a bug in handling an error occured during reading from

a pipe in _ipconfig_getnode().
üst f54c3501
......@@ -383,13 +383,11 @@ def _ipconfig_getnode():
pipe = os.popen(os.path.join(dir, 'ipconfig') + ' /all')
except OSError:
continue
else:
with pipe:
for line in pipe:
value = line.split(':')[-1].strip().lower()
if re.match('([0-9a-f][0-9a-f]-){5}[0-9a-f][0-9a-f]', value):
return int(value.replace('-', ''), 16)
finally:
pipe.close()
def _netbios_getnode():
"""Get the hardware address on Windows using NetBIOS calls.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment