Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f54c350 commit c70386eCopy full SHA for c70386e
1 file changed
Lib/uuid.py
@@ -383,13 +383,11 @@ def _ipconfig_getnode():
383
pipe = os.popen(os.path.join(dir, 'ipconfig') + ' /all')
384
except OSError:
385
continue
386
- else:
+ with pipe:
387
for line in pipe:
388
value = line.split(':')[-1].strip().lower()
389
if re.match('([0-9a-f][0-9a-f]-){5}[0-9a-f][0-9a-f]', value):
390
return int(value.replace('-', ''), 16)
391
- finally:
392
- pipe.close()
393
394
def _netbios_getnode():
395
"""Get the hardware address on Windows using NetBIOS calls.
0 commit comments