MCPcopy Create free account
hub / github.com/python/cpython / get_msvcr

Function get_msvcr

Tools/c-analyzer/distutils/cygwinccompiler.py:57–80  ·  view source on GitHub ↗

Include the appropriate MSVC runtime library if Python was built with MSVC 7.0 or later.

()

Source from the content-addressed store, hash-verified

55from distutils.spawn import find_executable
56
57def get_msvcr():
58 """Include the appropriate MSVC runtime library if Python was built
59 with MSVC 7.0 or later.
60 """
61 msc_pos = sys.version.find('MSC v.')
62 if msc_pos != -1:
63 msc_ver = sys.version[msc_pos+6:msc_pos+10]
64 if msc_ver == '1300':
65 # MSVC 7.0
66 return ['msvcr70']
67 elif msc_ver == '1310':
68 # MSVC 7.1
69 return ['msvcr71']
70 elif msc_ver == '1400':
71 # VS2005 / MSVC 8.0
72 return ['msvcr80']
73 elif msc_ver == '1500':
74 # VS2008 / MSVC 9.0
75 return ['msvcr90']
76 elif msc_ver == '1600':
77 # VS2010 / MSVC 10.0
78 return ['msvcr100']
79 else:
80 raise ValueError("Unknown MS Compiler version %s " % msc_ver)
81
82
83class CygwinCCompiler(UnixCCompiler):

Callers 2

__init__Method · 0.85
__init__Method · 0.85

Calls 1

findMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…