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)
| 343 | ) |
| 344 | |
| 345 | def 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 |
no test coverage detected
searching dependent graphs…