
    m&phr
              
          S r SSKrSSKrSSKrSSKrSSKJrJrJrJ	r	  SSK
Jr   " S S\5      rS\S	\\   4S
 jr\R                  S\S	\\   4S j5       rS\	\   S	\\   4S jr\S:X  a  SSKr\R(                  " 5       r\R-                  S5      (       d   S5       e\" S\5        \" S\" \R0                  5      5        \" SSS9  \" \R2                  " SS\R5                  SS5      S   5      5       H
  r\" \SS9  M     gg)zPEP 656 support.

This module implements logic to detect if the currently running Python is
linked against musl, and what musl version is used.
    N)Iterator
NamedTupleOptionalSequence   )ELFFilec                   *    \ rS rSr% \\S'   \\S'   Srg)_MuslVersion   majorminor N)__name__
__module____qualname____firstlineno__int__annotations____static_attributes__r       V/var/www/html/venv/lib/python3.13/site-packages/wheel/vendored/packaging/_musllinux.pyr
   r
      s    JJr   r
   outputreturnc                 Z   S U R                  5        5        Vs/ s H  o(       d  M  UPM     nn[        U5      S:  d  US   S S S:w  a  g [        R                  " SUS   5      nU(       d  g [	        [        UR                  S5      5      [        UR                  S5      5      S9$ s  snf )	Nc              3   @   #    U  H  oR                  5       v   M     g 7f)N)strip).0ns     r   	<genexpr>&_parse_musl_version.<locals>.<genexpr>   s     @,?q,?s      r      muslzVersion (\d+)\.(\d+)r   )r   r   )
splitlineslenrematchr
   r   group)r   r   linesms       r   _parse_musl_versionr+      s    @F,=,=,?@F@1AQ@EF
5zA~q"1/
(%(3Ac!''!*oS_EE Gs
   
B(B(
executablec                 8    [        U S5       n[        U5      R                  nSSS5        Wb  SU;  a  g[        R                  " U/[        R                  SS9n[        UR                  5      $ ! , (       d  f       NR= f! [        [        [
        4 a     gf = f)aD  Detect currently-running musl runtime version.

This is done by checking the specified executable's dynamic linking
information, and invoking the loader to parse its output for a version
string. If the loader is musl, the output would be something like::

    musl libc (x86_64)
    Version 1.2.2
    Dynamic Program Loader
rbNr#   T)stderrtext)openr   interpreterOSError	TypeError
ValueError
subprocessrunPIPEr+   r/   )r,   fldprocs       r   _get_musl_versionr<      s    *d#q''B $ 
zV2%>>2$zTBDt{{++ $#Y
+ s-   B A0B 0
A>:B >B BBarchsc              #      #    [        [        R                  5      nUc  gU  H8  n[        UR                  SS5       H  nSUR
                   SU SU 3v   M     M:     g7f)a  Generate musllinux tags compatible to the current platform.

:param archs: Sequence of compatible architectures.
    The first one shall be the closest to the actual architecture and be the part of
    platform tag after the ``linux_`` prefix, e.g. ``x86_64``.
    The ``linux_`` prefix is assumed as a prerequisite for the current platform to
    be musllinux-compatible.

:returns: An iterator of compatible musllinux tags.
N
musllinux__)r<   sysr,   ranger   r   )r=   sys_muslarchr   s       r   platform_tagsrF   6   s]      !0H8>>2r2Ex~~.awav>> 3 s   AA__main__zlinux-z	not linuxzplat:zmusl:ztags: )endz[.-]rA   -r?   z
      )__doc__	functoolsr&   r6   rB   typingr   r   r   r   _elffiler   r
   strr+   	lru_cacher<   rF   r   	sysconfigget_platformplat
startswithprintr,   subsplittr   r   r   <module>rY      s)    	  
 ; ; : 
F F(> F ,# ,(<*@ , ,,?# ?8C= ?& z!!#D??8$$1k1$	'4	'$S^^45	's266'3

30B20FGHaZ  I r   