This repository was archived by the owner on Feb 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -459,10 +459,14 @@ def _netbios_getnode():
459
459
_uuid_generate_random = _uuid_generate_time = _UuidCreate = None
460
460
try :
461
461
import ctypes , ctypes .util
462
+ import sys
462
463
463
464
# The uuid_generate_* routines are provided by libuuid on at least
464
465
# Linux and FreeBSD, and provided by libc on Mac OS X.
465
- for libname in ['uuid' , 'c' ]:
466
+ _libnames = ['uuid' ]
467
+ if not sys .platform .startswith ('win' ):
468
+ _libnames .append ('c' )
469
+ for libname in _libnames :
466
470
try :
467
471
lib = ctypes .CDLL (ctypes .util .find_library (libname ))
468
472
except Exception :
@@ -473,6 +477,7 @@ def _netbios_getnode():
473
477
_uuid_generate_time = lib .uuid_generate_time
474
478
if _uuid_generate_random is not None :
475
479
break # found everything we were looking for
480
+ del _libnames
476
481
477
482
# The uuid_generate_* functions are broken on MacOS X 10.5, as noted
478
483
# in issue #8621 the function generates the same sequence of values
@@ -481,7 +486,6 @@ def _netbios_getnode():
481
486
#
482
487
# Assume that the uuid_generate functions are broken from 10.5 onward,
483
488
# the test can be adjusted when a later version is fixed.
484
- import sys
485
489
if sys .platform == 'darwin' :
486
490
import os
487
491
if int (os .uname ().release .split ('.' )[0 ]) >= 9 :
Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ Core and Builtins
15
15
Library
16
16
-------
17
17
18
+ - Issue #24634: Importing uuid should not try to load libc on Windows
19
+
18
20
- Issue #24798: _msvccompiler.py doesn't properly support manifests
19
21
20
22
- Issue #4395: Better testing and documentation of binary operators.
You can’t perform that action at this time.
0 commit comments