Viewing File: /opt/alt/python35/lib/python3.5/site-packages/pip/_internal/utils/__pycache__/glibc.cpython-35.pyc



“tÆ_áã@sˆddlmZddlZddlZddlmZerTddlmZmZdd„Z	dd„Z
d	d
„Zdd„ZdS)
é)Úabsolute_importN)ÚMYPY_CHECK_RUNNING)ÚOptionalÚTuplecCstƒptƒS)z9Returns glibc version string, or None if not using glibc.)Úglibc_version_string_confstrÚglibc_version_string_ctypes©rrúˆ/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-1.el7.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/utils/glibc.pyÚglibc_version_stringsr
c
CsXtjdkrdSytjdƒjƒ\}}Wntttfk
rSdSYnX|S)z@Primary implementation of glibc_version_string using os.confstr.Úwin32NÚCS_GNU_LIBC_VERSION)ÚsysÚplatformÚosÚconfstrÚsplitÚAttributeErrorÚOSErrorÚ
ValueError)Ú_Úversionrrr	rs	rcCs•yddl}Wntk
r(dSYnX|jdƒ}y
|j}Wntk
r]dSYnX|j|_|ƒ}t|tƒs‘|j	dƒ}|S)z=Fallback implementation of glibc_version_string using ctypes.rNÚascii)
ÚctypesÚImportErrorÚCDLLÚgnu_get_libc_versionrÚc_char_pÚrestypeÚ
isinstanceÚstrÚdecode)rÚprocess_namespacerÚversion_strrrr	r's
	

		rcCs'tƒ}|dkrdSd|fSdS)z“Try to determine the glibc version

    Returns a tuple of strings (lib, version) which default to empty strings
    in case the lookup fails.
    NÚÚglibc)r#r#)r
)Ú
glibc_versionrrr	Úlibc_verWs	r&)
Ú
__future__rrr
Úpip._internal.utils.typingrÚtypingrrr
rrr&rrrr	Ú<module>s0
Back to Directory File Manager