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 e178448 commit bc92836Copy full SHA for bc92836
Lib/ctypes/util.py
@@ -31,6 +31,12 @@ def _get_build_version():
31
# else we don't know what version of the compiler this is
32
return None
33
34
+ def find_msvcrt_mingw():
35
+ is_ucrt = 'clang' in sys.version.lower() or 'ucrt' in sys.version.lower()
36
+ if is_ucrt:
37
+ return None
38
+ return 'msvcrt.dll'
39
+
40
def find_msvcrt():
41
"""Return the name of the VC runtime dll"""
42
version = _get_build_version()
@@ -54,6 +60,9 @@ def find_msvcrt():
54
60
55
61
def find_library(name):
56
62
if name in ('c', 'm'):
63
+ import sysconfig
64
+ if sysconfig.get_platform().startswith('mingw'):
65
+ return find_msvcrt_mingw()
57
66
return find_msvcrt()
58
67
# See MSDN for the REAL search order.
59
68
for directory in os.environ['PATH'].split(os.pathsep):
0 commit comments