Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../usr/lib64/python3....
File: sysconfig.py
return tuple(sorted(_INSTALL_SCHEMES))
[500] Fix | Delete
[501] Fix | Delete
[502] Fix | Delete
def get_path_names():
[503] Fix | Delete
"""Return a tuple containing the paths names."""
[504] Fix | Delete
return _SCHEME_KEYS
[505] Fix | Delete
[506] Fix | Delete
[507] Fix | Delete
def get_paths(scheme=_get_default_scheme(), vars=None, expand=True):
[508] Fix | Delete
"""Return a mapping containing an install scheme.
[509] Fix | Delete
[510] Fix | Delete
``scheme`` is the install scheme name. If not provided, it will
[511] Fix | Delete
return the default scheme for the current platform.
[512] Fix | Delete
"""
[513] Fix | Delete
if expand:
[514] Fix | Delete
return _expand_vars(scheme, vars)
[515] Fix | Delete
else:
[516] Fix | Delete
return _INSTALL_SCHEMES[scheme]
[517] Fix | Delete
[518] Fix | Delete
[519] Fix | Delete
def get_path(name, scheme=_get_default_scheme(), vars=None, expand=True):
[520] Fix | Delete
"""Return a path corresponding to the scheme.
[521] Fix | Delete
[522] Fix | Delete
``scheme`` is the install scheme name.
[523] Fix | Delete
"""
[524] Fix | Delete
return get_paths(scheme, vars, expand)[name]
[525] Fix | Delete
[526] Fix | Delete
[527] Fix | Delete
def get_config_vars(*args):
[528] Fix | Delete
"""With no arguments, return a dictionary of all configuration
[529] Fix | Delete
variables relevant for the current platform.
[530] Fix | Delete
[531] Fix | Delete
On Unix, this means every variable defined in Python's installed Makefile;
[532] Fix | Delete
On Windows it's a much smaller set.
[533] Fix | Delete
[534] Fix | Delete
With arguments, return a list of values that result from looking up
[535] Fix | Delete
each argument in the configuration variable dictionary.
[536] Fix | Delete
"""
[537] Fix | Delete
global _CONFIG_VARS
[538] Fix | Delete
if _CONFIG_VARS is None:
[539] Fix | Delete
_CONFIG_VARS = {}
[540] Fix | Delete
# Normalized versions of prefix and exec_prefix are handy to have;
[541] Fix | Delete
# in fact, these are the standard versions used most places in the
[542] Fix | Delete
# Distutils.
[543] Fix | Delete
_CONFIG_VARS['prefix'] = _PREFIX
[544] Fix | Delete
_CONFIG_VARS['exec_prefix'] = _EXEC_PREFIX
[545] Fix | Delete
_CONFIG_VARS['py_version'] = _PY_VERSION
[546] Fix | Delete
_CONFIG_VARS['py_version_short'] = _PY_VERSION_SHORT
[547] Fix | Delete
_CONFIG_VARS['py_version_nodot'] = _PY_VERSION_SHORT_NO_DOT
[548] Fix | Delete
_CONFIG_VARS['installed_base'] = _BASE_PREFIX
[549] Fix | Delete
_CONFIG_VARS['base'] = _PREFIX
[550] Fix | Delete
_CONFIG_VARS['installed_platbase'] = _BASE_EXEC_PREFIX
[551] Fix | Delete
_CONFIG_VARS['platbase'] = _EXEC_PREFIX
[552] Fix | Delete
_CONFIG_VARS['projectbase'] = _PROJECT_BASE
[553] Fix | Delete
try:
[554] Fix | Delete
_CONFIG_VARS['abiflags'] = sys.abiflags
[555] Fix | Delete
except AttributeError:
[556] Fix | Delete
# sys.abiflags may not be defined on all platforms.
[557] Fix | Delete
_CONFIG_VARS['abiflags'] = ''
[558] Fix | Delete
[559] Fix | Delete
if os.name == 'nt':
[560] Fix | Delete
_init_non_posix(_CONFIG_VARS)
[561] Fix | Delete
if os.name == 'posix':
[562] Fix | Delete
_init_posix(_CONFIG_VARS)
[563] Fix | Delete
# For backward compatibility, see issue19555
[564] Fix | Delete
SO = _CONFIG_VARS.get('EXT_SUFFIX')
[565] Fix | Delete
if SO is not None:
[566] Fix | Delete
_CONFIG_VARS['SO'] = SO
[567] Fix | Delete
# Setting 'userbase' is done below the call to the
[568] Fix | Delete
# init function to enable using 'get_config_var' in
[569] Fix | Delete
# the init-function.
[570] Fix | Delete
_CONFIG_VARS['userbase'] = _getuserbase()
[571] Fix | Delete
[572] Fix | Delete
# Always convert srcdir to an absolute path
[573] Fix | Delete
srcdir = _CONFIG_VARS.get('srcdir', _PROJECT_BASE)
[574] Fix | Delete
if os.name == 'posix':
[575] Fix | Delete
if _PYTHON_BUILD:
[576] Fix | Delete
# If srcdir is a relative path (typically '.' or '..')
[577] Fix | Delete
# then it should be interpreted relative to the directory
[578] Fix | Delete
# containing Makefile.
[579] Fix | Delete
base = os.path.dirname(get_makefile_filename())
[580] Fix | Delete
srcdir = os.path.join(base, srcdir)
[581] Fix | Delete
else:
[582] Fix | Delete
# srcdir is not meaningful since the installation is
[583] Fix | Delete
# spread about the filesystem. We choose the
[584] Fix | Delete
# directory containing the Makefile since we know it
[585] Fix | Delete
# exists.
[586] Fix | Delete
srcdir = os.path.dirname(get_makefile_filename())
[587] Fix | Delete
_CONFIG_VARS['srcdir'] = _safe_realpath(srcdir)
[588] Fix | Delete
[589] Fix | Delete
# OS X platforms require special customization to handle
[590] Fix | Delete
# multi-architecture, multi-os-version installers
[591] Fix | Delete
if sys.platform == 'darwin':
[592] Fix | Delete
import _osx_support
[593] Fix | Delete
_osx_support.customize_config_vars(_CONFIG_VARS)
[594] Fix | Delete
[595] Fix | Delete
if args:
[596] Fix | Delete
vals = []
[597] Fix | Delete
for name in args:
[598] Fix | Delete
vals.append(_CONFIG_VARS.get(name))
[599] Fix | Delete
return vals
[600] Fix | Delete
else:
[601] Fix | Delete
return _CONFIG_VARS
[602] Fix | Delete
[603] Fix | Delete
[604] Fix | Delete
def get_config_var(name):
[605] Fix | Delete
"""Return the value of a single variable using the dictionary returned by
[606] Fix | Delete
'get_config_vars()'.
[607] Fix | Delete
[608] Fix | Delete
Equivalent to get_config_vars().get(name)
[609] Fix | Delete
"""
[610] Fix | Delete
if name == 'SO':
[611] Fix | Delete
import warnings
[612] Fix | Delete
warnings.warn('SO is deprecated, use EXT_SUFFIX', DeprecationWarning, 2)
[613] Fix | Delete
return get_config_vars().get(name)
[614] Fix | Delete
[615] Fix | Delete
[616] Fix | Delete
def get_platform():
[617] Fix | Delete
"""Return a string that identifies the current platform.
[618] Fix | Delete
[619] Fix | Delete
This is used mainly to distinguish platform-specific build directories and
[620] Fix | Delete
platform-specific built distributions. Typically includes the OS name and
[621] Fix | Delete
version and the architecture (as supplied by 'os.uname()'), although the
[622] Fix | Delete
exact information included depends on the OS; on Linux, the kernel version
[623] Fix | Delete
isn't particularly important.
[624] Fix | Delete
[625] Fix | Delete
Examples of returned values:
[626] Fix | Delete
linux-i586
[627] Fix | Delete
linux-alpha (?)
[628] Fix | Delete
solaris-2.6-sun4u
[629] Fix | Delete
[630] Fix | Delete
Windows will return one of:
[631] Fix | Delete
win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc)
[632] Fix | Delete
win32 (all others - specifically, sys.platform is returned)
[633] Fix | Delete
[634] Fix | Delete
For other non-POSIX platforms, currently just returns 'sys.platform'.
[635] Fix | Delete
[636] Fix | Delete
"""
[637] Fix | Delete
if os.name == 'nt':
[638] Fix | Delete
if 'amd64' in sys.version.lower():
[639] Fix | Delete
return 'win-amd64'
[640] Fix | Delete
if '(arm)' in sys.version.lower():
[641] Fix | Delete
return 'win-arm32'
[642] Fix | Delete
if '(arm64)' in sys.version.lower():
[643] Fix | Delete
return 'win-arm64'
[644] Fix | Delete
return sys.platform
[645] Fix | Delete
[646] Fix | Delete
if os.name != "posix" or not hasattr(os, 'uname'):
[647] Fix | Delete
# XXX what about the architecture? NT is Intel or Alpha
[648] Fix | Delete
return sys.platform
[649] Fix | Delete
[650] Fix | Delete
# Set for cross builds explicitly
[651] Fix | Delete
if "_PYTHON_HOST_PLATFORM" in os.environ:
[652] Fix | Delete
return os.environ["_PYTHON_HOST_PLATFORM"]
[653] Fix | Delete
[654] Fix | Delete
# Try to distinguish various flavours of Unix
[655] Fix | Delete
osname, host, release, version, machine = os.uname()
[656] Fix | Delete
[657] Fix | Delete
# Convert the OS name to lowercase, remove '/' characters, and translate
[658] Fix | Delete
# spaces (for "Power Macintosh")
[659] Fix | Delete
osname = osname.lower().replace('/', '')
[660] Fix | Delete
machine = machine.replace(' ', '_')
[661] Fix | Delete
machine = machine.replace('/', '-')
[662] Fix | Delete
[663] Fix | Delete
if osname[:5] == "linux":
[664] Fix | Delete
# At least on Linux/Intel, 'machine' is the processor --
[665] Fix | Delete
# i386, etc.
[666] Fix | Delete
# XXX what about Alpha, SPARC, etc?
[667] Fix | Delete
return "%s-%s" % (osname, machine)
[668] Fix | Delete
elif osname[:5] == "sunos":
[669] Fix | Delete
if release[0] >= "5": # SunOS 5 == Solaris 2
[670] Fix | Delete
osname = "solaris"
[671] Fix | Delete
release = "%d.%s" % (int(release[0]) - 3, release[2:])
[672] Fix | Delete
# We can't use "platform.architecture()[0]" because a
[673] Fix | Delete
# bootstrap problem. We use a dict to get an error
[674] Fix | Delete
# if some suspicious happens.
[675] Fix | Delete
bitness = {2147483647:"32bit", 9223372036854775807:"64bit"}
[676] Fix | Delete
machine += ".%s" % bitness[sys.maxsize]
[677] Fix | Delete
# fall through to standard osname-release-machine representation
[678] Fix | Delete
elif osname[:3] == "aix":
[679] Fix | Delete
return "%s-%s.%s" % (osname, version, release)
[680] Fix | Delete
elif osname[:6] == "cygwin":
[681] Fix | Delete
osname = "cygwin"
[682] Fix | Delete
import re
[683] Fix | Delete
rel_re = re.compile(r'[\d.]+')
[684] Fix | Delete
m = rel_re.match(release)
[685] Fix | Delete
if m:
[686] Fix | Delete
release = m.group()
[687] Fix | Delete
elif osname[:6] == "darwin":
[688] Fix | Delete
import _osx_support
[689] Fix | Delete
osname, release, machine = _osx_support.get_platform_osx(
[690] Fix | Delete
get_config_vars(),
[691] Fix | Delete
osname, release, machine)
[692] Fix | Delete
[693] Fix | Delete
return "%s-%s-%s" % (osname, release, machine)
[694] Fix | Delete
[695] Fix | Delete
[696] Fix | Delete
def get_python_version():
[697] Fix | Delete
return _PY_VERSION_SHORT
[698] Fix | Delete
[699] Fix | Delete
[700] Fix | Delete
def _print_dict(title, data):
[701] Fix | Delete
for index, (key, value) in enumerate(sorted(data.items())):
[702] Fix | Delete
if index == 0:
[703] Fix | Delete
print('%s: ' % (title))
[704] Fix | Delete
print('\t%s = "%s"' % (key, value))
[705] Fix | Delete
[706] Fix | Delete
[707] Fix | Delete
def _main():
[708] Fix | Delete
"""Display all information sysconfig detains."""
[709] Fix | Delete
if '--generate-posix-vars' in sys.argv:
[710] Fix | Delete
_generate_posix_vars()
[711] Fix | Delete
return
[712] Fix | Delete
print('Platform: "%s"' % get_platform())
[713] Fix | Delete
print('Python version: "%s"' % get_python_version())
[714] Fix | Delete
print('Current installation scheme: "%s"' % _get_default_scheme())
[715] Fix | Delete
print()
[716] Fix | Delete
_print_dict('Paths', get_paths())
[717] Fix | Delete
print()
[718] Fix | Delete
_print_dict('Variables', get_config_vars())
[719] Fix | Delete
[720] Fix | Delete
[721] Fix | Delete
if __name__ == '__main__':
[722] Fix | Delete
_main()
[723] Fix | Delete
[724] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function