MCPcopy Index your code
hub / github.com/python/cpython / get_default_compiler

Function get_default_compiler

Tools/c-analyzer/distutils/ccompiler.py:345–364  ·  view source on GitHub ↗

Determine the default compiler to use for the given platform. osname should be one of the standard Python OS names (i.e. the ones returned by os.name) and platform the common value returned by sys.platform for the platform in question. The default values are os.name and

(osname=None, platform=None)

Source from the content-addressed store, hash-verified

343 )
344
345def get_default_compiler(osname=None, platform=None):
346 """Determine the default compiler to use for the given platform.
347
348 osname should be one of the standard Python OS names (i.e. the
349 ones returned by os.name) and platform the common value
350 returned by sys.platform for the platform in question.
351
352 The default values are os.name and sys.platform in case the
353 parameters are not given.
354 """
355 if osname is None:
356 osname = os.name
357 if platform is None:
358 platform = sys.platform
359 for pattern, compiler in _default_compilers:
360 if re.match(pattern, platform) is not None or \
361 re.match(pattern, osname) is not None:
362 return compiler
363 # Default to Unix compiler
364 return 'unix'
365
366# Map compiler types to (module_name, class_name) pairs -- ie. where to
367# find the code that implements an interface to this compiler. (The module

Callers 1

new_compilerFunction · 0.85

Calls 1

matchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…