Lines Matching defs:sys

4 import sys
115 if sys.platform in {"emscripten", "vxworks", "wasi"}:
125 if sys.platform == "darwin" and sys._framework:
126 return joinuser("~", "Library", sys._framework,
127 f"{sys.version_info[0]}.{sys.version_info[1]}")
168 _PY_VERSION = sys.version.split()[0]
169 _PY_VERSION_SHORT = f'{sys.version_info[0]}.{sys.version_info[1]}'
170 _PY_VERSION_SHORT_NO_DOT = f'{sys.version_info[0]}{sys.version_info[1]}'
171 _PREFIX = os.path.normpath(sys.prefix)
172 _BASE_PREFIX = os.path.normpath(sys.base_prefix)
173 _EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
174 _BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix)
191 if sys.executable:
192 _PROJECT_BASE = os.path.dirname(_safe_realpath(sys.executable))
194 # sys.executable can be empty if argv[0] has been changed and Python is
198 # In a virtual environment, `sys._home` gives us the target directory
201 _sys_home = getattr(sys, '_home', None)
286 if sys.platform == 'darwin' and sys._framework:
300 if key == 'prefix' and sys.prefix != sys.base_prefix:
329 with open(filename, encoding=sys.getfilesystemencoding(),
447 if hasattr(sys, 'abiflags'):
448 config_dir_name = f'config-{_PY_VERSION_SHORT}{sys.abiflags}'
451 if hasattr(sys.implementation, '_multiarch'):
452 config_dir_name += f'-{sys.implementation._multiarch}'
457 multiarch = getattr(sys.implementation, '_multiarch', '')
460 f'_sysconfigdata_{sys.abiflags}_{sys.platform}_{multiarch}',
505 if 'darwin' in sys.platform:
509 sys.modules[name] = module
512 if hasattr(sys, "gettotalrefcount"):
523 # Create file used for sys.path fixup -- see Modules/getpath.c
545 vars['BINDIR'] = os.path.dirname(_safe_realpath(sys.executable))
655 _CONFIG_VARS['platlibdir'] = sys.platlibdir
657 _CONFIG_VARS['abiflags'] = sys.abiflags
659 # sys.abiflags may not be defined on all platforms.
662 _CONFIG_VARS['py_version_nodot_plat'] = sys.winver.replace('.', '')
668 _CONFIG_VARS['VPATH'] = sys._vpath
696 if sys.platform == 'darwin':
734 win32 (all others - specifically, sys.platform is returned)
736 For other non-POSIX platforms, currently just returns 'sys.platform'.
740 if 'amd64' in sys.version.lower():
742 if '(arm)' in sys.version.lower():
744 if '(arm64)' in sys.version.lower():
746 return sys.platform
750 return sys.platform
778 machine += f".{bitness[sys.maxsize]}"
838 if '--generate-posix-vars' in sys.argv: