3 ]J @sHddlmZddlZddlZddlZddZddZddZd d ZdS) )absolute_importNc CsPtjd}y |j}Wntk r(dSXtj|_|}t|tsL|jd}|S)z9Returns glibc version string, or None if not using glibc.Nascii) ctypesCDLLgnu_get_libc_versionAttributeErrorc_char_prestype isinstancestrdecode)process_namespacer version_strr6/tmp/pip-build-8jg9gmni/setuptools/setuptools/glibc.pyglibc_version_string s    rcCsHtjd|}|s$tjd|tdSt|jd|koFt|jd|kS)Nz$(?P[0-9]+)\.(?P[0-9]+)z=Expected glibc version with 2 components major.minor, got: %sFmajorminor)rematchwarningswarnRuntimeWarningintgroup)rrequired_major minimum_minormrrrcheck_glibc_version$s  rcCst}|dkrdSt|||S)NF)rr)rrrrrrhave_compatible_glibc4srcCst}|dkrdSd|fSdS)zTry to determine the glibc version Returns a tuple of strings (lib, version) which default to empty strings in case the lookup fails. Nglibc)r r )r) glibc_versionrrrlibc_verLsr#) __future__rrrrrrrr#rrrrs