Initialize the module as appropriate for NT
(vars)
| 382 | |
| 383 | |
| 384 | def _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 |
no test coverage detected
searching dependent graphs…