3 ‰K]J ã@sHddlmZddlZddlZddlZdd„Zdd„Zdd„Zd d „ZdS) é)Úabsolute_importNc CsPtjdƒ}y |j}Wntk r(dSXtj|_|ƒ}t|tƒsL|jdƒ}|S)z9Returns glibc version string, or None if not using glibc.NÚascii) ÚctypesZCDLLÚgnu_get_libc_versionÚAttributeErrorZc_char_pZrestypeÚ isinstanceÚstrÚdecode)Zprocess_namespacerÚ version_str©r ú/usr/lib/python3.6/glibc.pyÚglibc_version_string s    r cCsHtjd|ƒ}|s$tjd|tƒdSt|jdƒƒ|koFt|jdƒƒ|kS)Nz$(?P[0-9]+)\.(?P[0-9]+)z=Expected glibc version with 2 components major.minor, got: %sFÚmajorÚminor)ÚreÚmatchÚwarningsÚwarnÚRuntimeWarningÚintÚgroup)r Úrequired_majorÚ minimum_minorÚmr r r Úcheck_glibc_version$s  rcCstƒ}|dkrdSt|||ƒS)NF)r r)rrr r r r Úhave_compatible_glibc4srcCstƒ}|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ÚZglibc)rr)r )Z glibc_versionr r r Úlibc_verLsr) Z __future__rrrrr rrrr r r r Ús