B °-_ »ã @sNdZdZdZddlZddlZddlZddlZddlZddlZy ej Z Wn(e k rnej dkrfdZ ndZ YnXdZ d d d d d d d d dddœ Ze d¡Zdd„Ze dej¡Zejdddfdd„Zdd„Ze dej¡Ze dej¡Ze dej¡ZdZdd„Ze d ej¡Ze d!ej¡Ze d"ej¡Zddded#fd$d%„Z d&d'„Z!dddefd(d)„Z"dd,d-„Z#dŽd.d/„Z$e d0¡Z%dd2d3„Z&d4d5d6d7d8d9d:d;dd?œ Z'd6d@dAdBdCdDdEœZ(ddFdG„Z)dHdI„Z*d‘dKdL„Z+dMdN„Z,d’dOdP„Z-dQdR„Z.dSdT„Z/d“dUdV„Z0dWdX„Z1d”dYdZ„Z2d•d[d\„Z3d]d^d_d1œZ4ejddfd`da„Z5e 6dbdc¡Z7da8ddde„Z9dfdg„Z:dhdi„Z;djdk„Zdpdq„Z?e drej¡Z@e dsej¡ZAe dt¡ZBe du¡ZCiZDd–dvdw„ZEdxdy„ZFdzd{„ZGd|d}„ZHd~d„ZId€d„ZJd‚dƒ„ZKd„d…„ZLiZMd—d†d‡„Z eNdˆkrJd‰ejOkpdŠejOkZPd‹ejOko0dŒejOkZQeRe eQePƒƒe Sd¡dS)˜a8 This module tries to retrieve as much platform-identifying data as possible. It makes this information available via function APIs. If called from the command line, it prints the platform information concatenated as single string to stdout. The output format is useable as part of a filename. a Copyright (c) 1999-2000, Marc-Andre Lemburg; mailto:mal@lemburg.com Copyright (c) 2000-2010, eGenix.com Software GmbH; mailto:info@egenix.com Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee or royalty is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation or portions thereof, including modifications, that you make. EGENIX.COM SOFTWARE GMBH DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE ! z1.0.8éN)ÚdosÚwin32Úwin16ZNULz /dev/nullz/etcé ééé(é2éÈ) ZdevZalphaÚaZbetaÚbÚcZRCÚrcÚplÚpz([0-9]+|[._+-])c Csfg}x\t |¡D]N}|dkryt|dƒ}d}Wn tk rNt |d¡}YnX| ||f¡qW|S)Nz._+-rédr)Ú _component_reÚsplitÚintÚ ValueErrorÚ _ver_stagesÚgetÚextend)ÚversionÚresultÚvÚt©rú/usr/lib/python3.7/platform.pyÚ_comparable_versionœs rsC(__libc_init)|(GLIBC_([0-9.]+))|(libc(_\w+)?\.so(?:\.(\d[0-9.]*))?)Úi@c CsŽt}ttjdƒrtj |¡}t|dƒX}| |¡}d}x@|t|ƒkrzd|ksZd|krht  ||¡}nd}|r€|  ¡t|ƒkr¸| |¡} | r²|t |t|ƒdƒd…| }d}q<|s¸Pdd „|  ¡Dƒ\} } } } }}| rä|säd }nŒ| r|d krüd }| }n|| ƒ||ƒkrp| }n\| rp|d krpd }|rJ|rF||ƒ||ƒkrJ|}|rp|t|ƒ d…|krp||}|  ¡}qÖszlibc_ver..ZlibcÚglibc) rÚhasattrÚosÚpathr!ÚopenÚreadÚlenÚ _libc_searchÚsearchÚendÚmaxÚgroups)Ú executableZlibrZ chunksizeÚVÚfZbinaryÚposÚmÚchunkZlibcinitr(Z glibcversionZsoZthreadsZ soversionrrrÚlibc_ver°sJ     r:c Csptj d¡rˆd}tdƒ`}xX|D]P}| ¡}t|ƒdkr |\}}nq |dkrV| ¡}q |dkr | d¡}|d}q WWdQRX|||fStj d¡rætdƒD}x<|D]4}| d¡} t| ƒdkr¤| d d kr¤d | d |fSq¤WWdQRXtj d ¡rft d ¡} x:t t| ƒd d d ƒD]"} | | dd…dkr| | =qW| rf|   ¡d}| d dd…}|||fS|||fS)zÙ Tries some special tricks to get the distribution information in case the default method fails. Currently supports older SuSE Linux, Caldera OpenLinux and Slackware Linux distributions. z/var/adm/inst-log/infoÚSuSEéZMIN_DIST_VERSIONZ DIST_IDENTú-Nz/etc/.installedrZ OpenLinuxéz/usr/lib/setupéÿÿÿÿézslack-version-Ú slackware) r*r+Úexistsr,rr.ÚstripÚisdirÚlistdirÚrangeÚsort) ÚdistnamerÚidr6ÚlineZtvÚtagÚvalueÚvaluesZpkgZverfilesÚnrrrÚ_dist_try_harderês>               rOz(\w+)[-_](release|version)z'(.+) release ([\d.]+)[^(]*(?:\((.+)\))?z1([^0-9]+)(?: release )?([\d.]+)[^(]*(?:\((.+)\))?)r;ZdebianZfedoraZredhatZcentosZmandrakeZmandrivaZrocksrAZ yellowdogZgentooZ UnitedLinuxZ turbolinuxZarchZmageiaZUbuntucCszd}d}t |¡}|dk r&t| ¡ƒSt |¡}|dk rDt| ¡ƒS| ¡ ¡}|rp|d}t|ƒdkrp|d}d||fS)Nr rr>)Ú_lsb_release_versionÚmatchÚtupler3Ú_release_versionrCrr.)Ú firstlinerrIr8ÚlrrrÚ_parse_release_file0s      rVz(?:DISTRIB_ID\s*=)\s*(.*)z(?:DISTRIB_RELEASE\s*=)\s*(.*)z(?:DISTRIB_CODENAME\s*=)\s*(.*)r>cCs(ddl}|jdtddt|||||ƒS)NrzFdist() and linux_distribution() functions are deprecated in Python 3.5r<)Ú stacklevel)ÚwarningsÚwarnÚDeprecationWarningÚ_linux_distribution)rHrrIÚsupported_distsÚfull_distribution_namerXrrrÚlinux_distributionOs   r^c CsŠyŽtddƒz}x`|D]X}t |¡}|r4| d¡ ¡}t |¡}|rP| d¡ ¡} t |¡}|r| d¡ ¡} qW|r‚| r‚|| | fSWdQRXWnttfk r¦YnXyt   t ¡} Wnt k rÐ|||fSX|   ¡xD| D]0} t | ¡}|dk rà| ¡\} }| |krà| }PqàWt|||ƒStt j t | ¡dddd}| ¡}WdQRXt|ƒ\} }}| rl|rl| }|rv|}|r€|}|||fS)aæ Tries to determine the name of the Linux OS distribution name. The function first looks for a distribution release file in /etc and then reverts to _dist_try_harder() in case no suitable files are found. supported_dists may be given to define the set of Linux distributions to look for. It defaults to a list of currently supported Linux distributions identified by their release file name. If full_distribution_name is true (default), the full distribution read from the OS is returned. Otherwise the short name taken from supported_dists is used. Returns a tuple (distname, version, id) which default to the args given as parameters. z/etc/lsb-releaseÚrr>Nzutf-8Úsurrogateescape)ÚencodingÚerrors)r,Ú_distributor_id_file_rer0ÚgrouprCÚ_release_file_reÚ_codename_file_reÚEnvironmentErrorÚUnboundLocalErrorr*rEÚ _UNIXCONFDIRÚOSErrorrGÚ_release_filenamerQr3rOr+ÚjoinÚreadlinerV)rHrrIr\r]Z etclsbrelrJr8Z _u_distnameZ _u_versionZ_u_idZetcÚfileZ _distnameZdummyr6rTZ_versionZ_idrrrr[YsP            r[cCs*ddl}|jdtddt||||ddS)aS Tries to determine the name of the Linux OS distribution name. The function first looks for a distribution release file in /etc and then reverts to _dist_try_harder() in case no suitable files are found. Returns a tuple (distname, version, id) which default to the args given as parameters. rNzFdist() and linux_distribution() functions are deprecated in Python 3.5r<)rW)r\r])rXrYrZr[)rHrrIr\rXrrrÚdist¢s  ror_r?cCs&ddl}|jdtddt |||¡S)z! Portable popen() interface. rNzuse os.popen insteadr<)rW)rXrYrZr*Úpopen)ÚcmdÚmodeÚbufsizerXrrrrp·srpcCsd| d¡}|r| |¡ytt|ƒ}Wntk r>|}YnXttt|ƒƒ}d |dd…¡}|S)zŒ Normalize the version and build strings and return a single version string using the format major.minor.build (or patchlevel). Ú.Né)rÚappendÚmaprrÚlistÚstrrl)rÚbuildrUZintsZstringsrrrÚ _norm_versionÀs   r{z'(?:([\w ]+) ([\w.]+) .*\[.* ([\d.]+)\])©rrrc Csätj|kr|||fSxddD]R}y&t |¡}| ¡}| ¡rBtdƒ‚Wn$tk rh}zwWdd}~XYqXPqW|||fS| ¡}t  |¡}|dk rÚ|  ¡\}}}|ddkrº|dd…}|ddkrÒ|dd…}t |ƒ}|||fS)a+ Tries to figure out the OS version used and returns a tuple (system, release, version). It uses the "ver" shell command for this which is known to exists on Windows, DOS. XXX Others too ? In case this fails, the given parameters are used as defaults. )Zverzcommand /c verz cmd /c verzcommand failedNr?rt) ÚsysÚplatformr*rpr-ÚcloserjrCÚ _ver_outputrQr3r{) ÚsystemÚreleaserZsupported_platformsrqÚpipeÚinfoZwhyr8rrrÚ _syscmd_verÞs,           r…Z2000ZXPZ 2003ServerZpost2003ÚVistaÚ7Ú8z8.1zpost8.1Z10Zpost10) )ér)r‰r>)r‰r<)r‰N)ér)rŠr>)rŠr<)rŠru)rŠN)rr)rNZ 2008ServerZ 2008ServerR2Z 2012ServerZ 2012ServerR2Zpost2012ServerR2))r‰r<)rŠr)rŠr>)rŠr<)rŠru)rŠNcCsªyddlm}Wntk r,||||fSXyddlm}m}m}m}Wn,tk rvddlm}m}m}m}YnX|ƒ} | j pŽ| dd…\} } } d  | | | ¡}t   | | f¡pÂt   | df¡pÂ|}| dd…| | fkr$yd  | j ¡}Wn8tk r"|dd…d krd |dd…}YnXt| d dƒdkrZt  | | f¡pXt  | df¡pX|}d} z.y||d ƒ} || d ƒd}Wn YnXWd| rœ|| ƒX||||fS)Nr)Úgetwindowsversion)Ú OpenKeyExÚ QueryValueExÚCloseKeyÚHKEY_LOCAL_MACHINEruz {0}.{1}.{2}r<zSP{}é z Service Pack ZSPZ product_typez,SOFTWARE\Microsoft\Windows NT\CurrentVersionZ CurrentType)r}r‹Ú ImportErrorÚwinregrŒrrŽrÚ_winregZplatform_versionÚformatÚ_WIN32_CLIENT_RELEASESrZservice_pack_majorÚAttributeErrorÚgetattrÚ_WIN32_SERVER_RELEASES)r‚rÚcsdÚptyper‹rŒrrŽrZwinverZmajÚminrzÚkeyrrrÚ win32_ver,sD  rc Cs‚d}tj |¡sdSy ddl}Wntk r4dSXt|dƒ}| |¡}WdQRX|d}d}t ¡j}|dkrxd}|||fS)Nz0/System/Library/CoreServices/SystemVersion.plistrr"ZProductVersion)r r r )ZppczPower MacintoshZPowerPC) r*r+rBÚplistlibr‘r,ÚloadÚunameÚmachine)Úfnržr6rr‚Ú versioninfor¡rrrÚ _mac_ver_xml\s    r¤©r r r cCstƒ}|dk r|S|||fS)a< Get MacOS version information and return it as tuple (release, versioninfo, machine) with versioninfo being a tuple (version, dev_stage, non_release_version). Entries which cannot be determined are set to the parameter values which default to ''. All tuple entries are strings. N)r¤)r‚r£r¡r„rrrÚmac_verrs r¦cCs@ddlm}y| |¡}|dkr$|S|Stk r:|SXdS)Nr)ÚSystem)Ú java.langr§Z getPropertyr–)ÚnameÚdefaultr§rLrrrÚ _java_getprop…s  r«c Cs®y ddl}Wntk r(||||fSXtd|ƒ}td|ƒ}|\}}}td|ƒ}td|ƒ}td|ƒ}|||f}|\}} } td| ƒ} td |ƒ}td | ƒ} || | f}||||fS) a] Version interface for Jython. Returns a tuple (release, vendor, vminfo, osinfo) with vminfo being a tuple (vm_name, vm_release, vm_vendor) and osinfo being a tuple (os_name, os_version, os_arch). Values which cannot be determined are set to the defaults given as parameters (which all default to ''). rNz java.vendorz java.versionz java.vm.namezjava.vm.vendorzjava.vm.versionz java.os.archz java.os.namezjava.os.version)r¨r‘r«) r‚ÚvendorÚvminfoÚosinfoÚjavaZvm_nameZ vm_releaseZ vm_vendorÚos_nameÚ os_versionÚos_archrrrÚjava_vers"              r³cCsÌ|dkrd|||fS|dkr–|dkr0|||fS| d¡}|r‚yt|dƒ}Wntk rbYn X|d}t|ƒ|d<d |¡}|dkrd }qÂd }n,|d kr¶d }|r°|d }qÂd }n |dkrÂd}|||fS)zã Returns (system, release, version) aliased to common marketing names used for some systems. It also does some reordering of the information in some cases where it would otherwise cause confusion. ZRhapsodyzMacOS X ServerZSunOSÚ5rtrruÚ6ZSolarisZIRIX64ZIRIXz (64bit)Ú64bit)rrÚWindows)rrrryrl)rr‚rrUÚmajorrrrÚ system_alias³s2      r¹cGsÈd dd„tt|ƒDƒ¡}| dd¡}| dd¡}| dd¡}| dd¡}| d d¡}| d d¡}| d d¡}| d d¡}| d d¡}x| dd¡}||kržP|}qˆWx|ddkrÂ|dd…}q¨W|S)zq Helper to format the platform string in a filename compatible format e.g. "system-version-machine". r=css|]}| ¡VqdS)N)rC)r%Úxrrrú ïsz_platform..ú Ú_ú/ú\ú:ú;ú"ú(ú)Úunknownr z--r?N)rlÚfilterr.Úreplace)Úargsr~ZcleanedrrrÚ _platformés$          rÉcCsDy ddl}Wntk r |SXy| ¡Stk r>|SXdS)z8 Helper to determine the node name of this machine. rN)Úsocketr‘Z gethostnamerj)rªrÊrrrÚ_node s rËcCsFtj |¡}x4tj |¡r@tj tj tj |¡t |¡¡¡}qW|S)zT In case filepath is a symlink, follow it until a real file is reached. )r*r+ÚabspathÚislinkÚnormpathrlÚdirnameÚreadlink)ÚfilepathrrrÚ_follow_symlinkss  "rÒc Csftjdkr|Syt d|tf¡}Wnttfk r<|SX| ¡ ¡}|  ¡}|rZ|r^|S|SdS)z. Interface to the system's uname command. )rrrzuname %s 2> %sN) r}r~r*rpÚDEV_NULLr–rjr-rCr)Zoptionrªr6ÚoutputrrrrÚ _syscmd_uname#s  rÕc Csztjdkr|St|ƒ}ytjd|gtjtjd}Wnttfk rJ|SX|  ¡d  d¡}|  ¡}|rn|rr|S|SdS)zð Interface to the system's file command. The function uses the -b option of the file command to have it omit the filename in its output. Follow the symlinks. It returns default in case the command should fail. )rrrrn)ÚstdoutÚstderrrzlatin-1N) r}r~rÒÚ subprocessÚPopenÚPIPEZSTDOUTr–rjZ communicater$Úwait)ÚtargetrªÚprocrÔrrrrÚ _syscmd_file5s  rÞ)r Ú WindowsPE)r r·)r ÚMSDOScCs*|sLddl}y| d¡}Wn |jk r:| d¡}YnXt|dƒd}|r\t|dƒ}nd}|sž|tjkržtjtkr–ttj\}}|rŽ|}|r–|}||fSd|kr®||fSd |kr¼d }nd |krÊd }n d |krÖd}d|kräd}n>d|krd|krüd}nd}n d|krd}nd|kr"d}n||fS)a” Queries the given executable (defaults to the Python interpreter binary) for various architecture information. Returns a tuple (bits, linkage) which contains information about the bit architecture and the linkage format used for the executable. Both values are returned as strings. Values that cannot be determined are returned as given by the parameter presets. If bits is given as '', the sizeof(pointer) (or sizeof(long) on Python version < 1.5.2) is used as indicator for the supported pointer size. The function relies on the system's "file" command to do the actual work. This is available on most if not all Unix platforms. On some non-Unix platforms where the "file" command does not exist and the executable is set to the Python interpreter binary defaults from _default_architecture are used. rNÚPrUéÚbitr r4z32-bitÚ32bitZN32Zn32bitz64-bitr¶ZELFZPEr·rßZCOFFzMS-DOSrà) ÚstructZcalcsizeÚerrorryrÞr}r4r~Ú_default_architecture)r4ÚbitsÚlinkageråÚsizeZfileoutr rUrrrÚ architectureYsL      rëÚ uname_resultz-system node release version machine processorcCsœd}tdk rtSd}yt ¡\}}}}}Wntk rBd}YnX|sbttd|||||fƒƒsœ|r~tj}d}d}tƒ}d}d}|dkrât ƒ\}}}} |r¤|r¤d}|sÐdtj krÂtj   dd¡}ntj   dd¡}|sâtj   d|¡}|r:t |ƒ\}}}|d krd }n4|d kr:|d kr:d }d |dd …kr6d}nd}|dkrd|s^|dkrZd}nd}d }n8|dd…dkrœt ƒ\}} } } d}d | ¡}|sœ| }|dkr|r¶|dkr¾|}d}y ddl} Wntk ràYn&X|  dd¡\}}|dkrd}nd}|stddƒ}|dkr$d}|dkr2d}|dkr@d}|dkrNd}|dkr\d}|dkrjd}|d kr†|d kr†d }d}t||||||ƒatS)an Fairly portable uname interface. Returns a tuple of strings (system, node, release, version, machine, processor) identifying the underlying platform. Note that unlike the os.uname function this also returns possible processor information as an additional tuple entry. Entries which cannot be determined are set to ''. rNr r>rZPROCESSOR_ARCHITEW6432ZPROCESSOR_ARCHITECTUREZPROCESSOR_IDENTIFIERzMicrosoft Windowsr·Z Microsoftz6.0rur†)rrräZ16bitér¯ÚJavaz, ZOpenVMSÚ0zSYI$_CPUé€ZAlphaZVAXz-prÅ)Ú _uname_cacher*r r–rxrÆr}r~rËrÚenvironrr…r³rlÚvms_libr‘ZgetsyirÕrì)Z no_os_unameÚ processorrÚnoder‚rr¡Zuse_syscmd_verr™ršr¬r­r®róZcsidZ cpu_numberrrrr ²sž                  r cCstƒjS)z Returns the system/OS name, e.g. 'Linux', 'Windows' or 'Java'. An empty string is returned if the value cannot be determined. )r rrrrrr<srcCstƒjS)z Returns the computer's network name (which may not be fully qualified) An empty string is returned if the value cannot be determined. )r rõrrrrrõEsrõcCstƒjS)z Returns the system's release, e.g. '2.2.0' or 'NT' An empty string is returned if the value cannot be determined. )r r‚rrrrr‚Osr‚cCstƒjS)z‡ Returns the system's release version, e.g. '#3 on degas' An empty string is returned if the value cannot be determined. )r rrrrrrXsrcCstƒjS)zt Returns the machine type, e.g. 'i386' An empty string is returned if the value cannot be determined. )r r¡rrrrr¡asr¡cCstƒjS)a Returns the (true) processor name, e.g. 'amdk6' An empty string is returned if the value cannot be determined. Note that many platforms do not provide this information or simply return the same value as for machine(), e.g. NetBSD does this. )r rôrrrrrôjs rôzL([\w.+]+)\s*\(#?([^,]+)(?:,\s*([\w ]*)(?:,\s*([\w :]*))?)?\)\s*\[([^\]]+)\]?z;IronPython\s*([\d\.]+)(?: \(([\d\.]+)\))? on (.NET [\d\.]+)zU([\d.]+)\s*\(IronPython\s*[\d.]+\s*\(([\d.]+)\) on ([\w.]+ [\d.]+(?: \(\d+-bit\))?)\)zE([\w.+]+)\s*\(#?([^,]+),\s*([\w ]+),\s*([\w :]+)\)\s*\[PyPy [^\]]+\]?cCs|dkrtj}t |d¡}|dk r&|Sd|kr‚d}| d¡rHt |¡}n t |¡}|dkrjtdt |ƒƒ‚|  ¡\}}}d}d}nütj  d¡rÚd}t  |¡}|dkr´tdt |ƒƒ‚|  ¡\}}}} } |dkrÒd}tj }n¤d|kr"d}t  |¡}|dkr td t |ƒƒ‚|  ¡\}}}} d}n\t  |¡}|dkrFtd t |ƒƒ‚|  ¡\}}}} }d }|dkrld}n| r~|d | }ttd ƒr˜tj\} } } n"ttdƒr²tj\} } } nd} d} | d¡} t| ƒdkræ|  d¡d | ¡}||| | |||f}|t|<|S)aÛ Returns a parsed version of Python's sys.version as tuple (name, version, branch, revision, buildno, builddate, compiler) referring to the Python implementation name, version, branch, revision, build number, build date/time as string and the compiler identification string. Note that unlike the Python sys.version, the returned value for the Python version will always include the patchlevel (it defaults to '.0'). The function returns empty strings for tuple entries that cannot be determined. sys_version may be given to parse an alternative version string, e.g. if the version was read from a different Python interpreter. NZ IronPythonz*failed to parse IronPython sys.version: %sr r¯ZJythonz&failed to parse Jython sys.version: %sZPyPyz$failed to parse PyPy sys.version: %sz'failed to parse CPython sys.version: %sZCPythonr¼Ú_gitÚ _mercurialrtr<rï)r}rÚ_sys_version_cacherÚ startswithÚ_ironpython_sys_version_parserrQÚ _ironpython26_sys_version_parserrÚreprr3r~Ú_sys_version_parserÚ_pypy_sys_version_parserr)rör÷rr.rvrl)Ú sys_versionrr©rQrZ alt_versionZcompilerZbuildnoZ builddateZ buildtimer½ÚbranchZrevisionrUrrrÚ _sys_version”sx                      rcCs tƒdS)aR Returns a string identifying the Python implementation. Currently, the following implementations are identified: 'CPython' (C implementation of Python), 'IronPython' (.NET implementation of Python), 'Jython' (Java implementation of Python), 'PyPy' (Python implementation of Python). r)rrrrrÚpython_implementationüs rcCs tƒdS)zÈ Returns the Python version as string 'major.minor.patchlevel' Note that unlike the Python sys.version, the returned value will always include the patchlevel (it defaults to 0). r>)rrrrrÚpython_version srcCsttƒd d¡ƒS)zÝ Returns the Python version as tuple (major, minor, patchlevel) of strings. Note that unlike the Python sys.version, the returned value will always include the patchlevel (it defaults to 0). r>rt)rRrrrrrrÚpython_version_tuples rcCs tƒdS)zá Returns a string identifying the Python implementation branch. For CPython this is the SCM branch from which the Python binary was built. If not available, an empty string is returned. r<)rrrrrÚ python_branchs rcCs tƒdS)zå Returns a string identifying the Python implementation revision. For CPython this is the SCM revision from which the Python binary was built. If not available, an empty string is returned. ru)rrrrrÚpython_revision,s rcCstƒdd…S)zh Returns a tuple (buildno, builddate) stating the Python build number and date as strings. rírŠ)rrrrrÚ python_build9srcCs tƒdS)zS Returns a string identifying the compiler used for compiling Python. rŠ)rrrrrÚpython_compilerAsrc CsÄt ||fd¡}|dk r|Stƒ\}}}}}}||kr:d}|rPt|||ƒ\}}}|dkrŠt|ƒ\} } } } |rxt||ƒ} nt|||| ƒ} n*|dkr t ¡"t ddt ¡t dƒ\}}}WdQRX|rä|sät||||d|||ƒ} n$t t j ƒ\}}t||||d||ƒ} nª|dkrXtƒ\}}}\}}}|s4|sBt|||ƒ} nt|||d |||ƒ} n\|d kr‚|rtt||ƒ} n t|||ƒ} n2|r”t||ƒ} n tt j ƒ\}}t||||||ƒ} | t||f<| S) aË Returns a single string identifying the underlying platform with as much useful information as possible (but no more :). The output is intended to be human readable rather than machine parseable. It may look different on different platforms and this is intended. If "aliased" is true, the function will use aliases for various platforms that report system names which differ from their common names, e.g. SunOS will be reported as Solaris. The system_alias() function is used to implement this. Setting terse to true causes the function to return only the absolute minimum information needed to identify the platform. Nr r·)ZLinuxÚignorez?dist\(\) and linux_distribution\(\) functions are deprecated .*ÚwithrîZonZMacOS)Ú_platform_cacherr r¹rrÉrXÚcatch_warningsÚfilterwarningsrZror:r}r4r³rë)ÚaliasedÚterserrrõr‚rr¡rôZrelZversr™ršr~rHZ distversionZdistidZlibcnameZ libcversionr_rr­r°r±r²rèrérrrr~Ms\               r~Ú__main__rz--terseZ nonaliasedz --nonaliased)r_r?)r )r r r r|)r r r r )r r¥r )r r r¥r¥)r )r )r )N)rr)TÚ__doc__Z __copyright__Ú __version__Ú collectionsr}r*ÚrerØrXÚdevnullrÓr–r~rirÚcompilerrÚASCIIr/r4r:rOrkrPrSZ_supported_distsrVÚIrcrerfr^r[rorpr{r€r…r•r˜rr¤r¦r«r³r¹rÉrËrÒrÕrÞrçrëÚ namedtuplerìrñr rrõr‚rr¡rôrýrúrûrþrørrrrrrrrr Ú__name__ÚargvrrÚprintÚexitrrrrÚ säe      :2 I    0 0  #6   T       h      [