()
| 502 | |
| 503 | |
| 504 | def _init_config_vars(): |
| 505 | global _CONFIG_VARS |
| 506 | _CONFIG_VARS = {} |
| 507 | |
| 508 | prefix = os.path.normpath(sys.prefix) |
| 509 | exec_prefix = os.path.normpath(sys.exec_prefix) |
| 510 | base_prefix = _BASE_PREFIX |
| 511 | base_exec_prefix = _BASE_EXEC_PREFIX |
| 512 | |
| 513 | try: |
| 514 | abiflags = sys.abiflags |
| 515 | except AttributeError: |
| 516 | abiflags = '' |
| 517 | |
| 518 | if os.name == 'posix': |
| 519 | _init_posix(_CONFIG_VARS) |
| 520 | # If we are cross-compiling, load the prefixes from the Makefile instead. |
| 521 | if '_PYTHON_PROJECT_BASE' in os.environ: |
| 522 | prefix = _CONFIG_VARS['host_prefix'] |
| 523 | exec_prefix = _CONFIG_VARS['host_exec_prefix'] |
| 524 | base_prefix = _CONFIG_VARS['host_prefix'] |
| 525 | base_exec_prefix = _CONFIG_VARS['host_exec_prefix'] |
| 526 | abiflags = _CONFIG_VARS['ABIFLAGS'] |
| 527 | |
| 528 | # Normalized versions of prefix and exec_prefix are handy to have; |
| 529 | # in fact, these are the standard versions used most places in the |
| 530 | # Distutils. |
| 531 | _CONFIG_VARS['prefix'] = prefix |
| 532 | _CONFIG_VARS['exec_prefix'] = exec_prefix |
| 533 | _CONFIG_VARS['py_version'] = _PY_VERSION |
| 534 | _CONFIG_VARS['py_version_short'] = _PY_VERSION_SHORT |
| 535 | _CONFIG_VARS['py_version_nodot'] = _PY_VERSION_SHORT_NO_DOT |
| 536 | _CONFIG_VARS['installed_base'] = base_prefix |
| 537 | _CONFIG_VARS['base'] = prefix |
| 538 | _CONFIG_VARS['installed_platbase'] = base_exec_prefix |
| 539 | _CONFIG_VARS['platbase'] = exec_prefix |
| 540 | _CONFIG_VARS['projectbase'] = _PROJECT_BASE |
| 541 | _CONFIG_VARS['platlibdir'] = sys.platlibdir |
| 542 | _CONFIG_VARS['implementation'] = _get_implementation() |
| 543 | _CONFIG_VARS['implementation_lower'] = _get_implementation().lower() |
| 544 | _CONFIG_VARS['abiflags'] = abiflags |
| 545 | try: |
| 546 | _CONFIG_VARS['py_version_nodot_plat'] = sys.winver.replace('.', '') |
| 547 | except AttributeError: |
| 548 | _CONFIG_VARS['py_version_nodot_plat'] = '' |
| 549 | |
| 550 | if os.name == 'nt': |
| 551 | _init_non_posix(_CONFIG_VARS) |
| 552 | _CONFIG_VARS['VPATH'] = sys._vpath |
| 553 | if _HAS_USER_BASE: |
| 554 | # Setting 'userbase' is done below the call to the |
| 555 | # init function to enable using 'get_config_var' in |
| 556 | # the init-function. |
| 557 | _CONFIG_VARS['userbase'] = _getuserbase() |
| 558 | |
| 559 | # e.g., 't' for free-threaded or '' for default build |
| 560 | _CONFIG_VARS['abi_thread'] = 't' if _CONFIG_VARS.get('Py_GIL_DISABLED') else '' |
| 561 |
no test coverage detected
searching dependent graphs…