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

Function _init_non_posix

Lib/sysconfig/__init__.py:384–421  ·  view source on GitHub ↗

Initialize the module as appropriate for NT

(vars)

Source from the content-addressed store, hash-verified

382
383
384def _init_non_posix(vars):
385 """Initialize the module as appropriate for NT"""
386 # set basic install directories
387 import _winapi
388 import _sysconfig
389 vars['LIBDEST'] = get_path('stdlib')
390 vars['BINLIBDEST'] = get_path('platstdlib')
391 vars['INCLUDEPY'] = get_path('include')
392
393 # Add EXT_SUFFIX, SOABI, Py_DEBUG, and Py_GIL_DISABLED
394 vars.update(_sysconfig.config_vars())
395
396 # NOTE: ABIFLAGS is only an emulated value. It is not present during build
397 # on Windows. sys.abiflags is absent on Windows and vars['abiflags']
398 # is already widely used to calculate paths, so it should remain an
399 # empty string.
400 vars['ABIFLAGS'] = ''.join(
401 (
402 't' if vars['Py_GIL_DISABLED'] else '',
403 '_d' if vars['Py_DEBUG'] else '',
404 ),
405 )
406
407 vars['LIBDIR'] = _safe_realpath(os.path.join(get_config_var('installed_base'), 'libs'))
408 if hasattr(sys, 'dllhandle'):
409 dllhandle = _winapi.GetModuleFileName(sys.dllhandle)
410 vars['LIBRARY'] = os.path.basename(_safe_realpath(dllhandle))
411 vars['LDLIBRARY'] = vars['LIBRARY']
412 vars['EXE'] = '.exe'
413 vars['VERSION'] = _PY_VERSION_SHORT_NO_DOT
414 vars['BINDIR'] = os.path.dirname(_safe_realpath(sys.executable))
415 # No standard path exists on Windows for this, but we'll check
416 # whether someone is imitating a POSIX-like layout
417 check_tzpath = os.path.join(vars['prefix'], 'share', 'zoneinfo')
418 if os.path.exists(check_tzpath):
419 vars['TZPATH'] = check_tzpath
420 else:
421 vars['TZPATH'] = ''
422
423#
424# public APIs

Callers 1

_init_config_varsFunction · 0.85

Calls 8

get_pathFunction · 0.85
_safe_realpathFunction · 0.85
get_config_varFunction · 0.85
updateMethod · 0.45
joinMethod · 0.45
basenameMethod · 0.45
dirnameMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…