ok

Mini Shell

Direktori : /opt/alt/python311/lib64/python3.11/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/__pycache__/_osx_support.cpython-311.pyc

�

�fV���dZddlZddlZddlZgd�ZdZdZdZdd�Zdd	�Z	d
�Z
dad�Zda
d�Zd
�Zd�Zdad�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZdS)zShared OS X support functions.�N)�compiler_fixup�customize_config_vars�customize_compiler�get_platform_osx)
�CFLAGS�LDFLAGS�CPPFLAGS�
BASECFLAGS�	BLDSHARED�LDSHARED�CC�CXX�	PY_CFLAGS�
PY_LDFLAGS�PY_CPPFLAGS�PY_CORE_CFLAGS�PY_CORE_LDFLAGS)rrr
r�_OSX_SUPPORT_INITIAL_c��|�tjd}|�tj��}tj�|��\}}tjdkr|dkr|dz}tj�|��sJ|D]E}tj�	||��}tj�|��r|cS�FdS|S)z�Tries to find 'executable' in the directories listed in 'path'.

    A string listing directories separated by 'os.pathsep'; defaults to
    os.environ['PATH'].  Returns the complete filename or None if not found.
    N�PATH�win32z.exe)
�os�environ�split�pathsep�path�splitext�sys�platform�isfile�join)�
executabler�paths�base�ext�p�fs       �3/opt/alt/python311/lib64/python3.11/_osx_support.py�_find_executabler)s����|��z�&�!���J�J�r�z�"�"�E��� � ��,�,�I�D�#������c�V�m�m��&�(�
�
�7�>�>�*�%�%���	�	�A�����Q�
�+�+�A��w�~�~�a� � �
�����
��t���Fc���ddl}	ddl}|���}n4#t$r't	dtj����d��}YnwxYw|�|��5}|r|�d|j�d�}n
|�d|j�d�}tj	|��s9|�
���d	�����ndcddd��S#1swxYwYdS)
z0Output from successful command execution or NonerNz/tmp/_osx_support.zw+bz >'z' 2>&1z 2>/dev/null >'�'�utf-8)
�
contextlib�tempfile�NamedTemporaryFile�ImportError�openr�getpid�closing�name�system�read�decode�strip)�
commandstring�capture_stderrr.r/�fp�cmds      r(�_read_outputr>7sh������"�����
�
(�
(�
*�
*�����"�"�"�
�T��I�K�K�K�� �"�"����"����
�	�	�B�	�	�Q�2��	D�%2�]�]�B�G�G�G�<�C�C�,9�M�M�2�7�7�7�C�C�8:�	�#���P�r�w�w�y�y����(�(�.�.�0�0�0�D�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q����Q�Q�Q�Q�Q�Qs"��.A�A�(A,C!�!C%�(C%c�H�t|��ptd|����pdS)z0Find a build tool on current path or using xcrunz/usr/bin/xcrun -find �)r)r>)�toolnames r(�_find_build_toolrBMs1���X�&�&�
��<�X�X� G�H�H�
��r*c��t��da	tdd���}	tjd|�����}|���n#|���wxYw|�Cd�|�d���d��dd	���an#t$rYnwxYwtS)
z*Return the OS X system version as a stringNr@z0/System/Library/CoreServices/SystemVersion.plistr-)�encodingz=<key>ProductUserVisibleVersion</key>\s*<string>(.*?)</string>�.��)
�_SYSTEM_VERSIONr2�re�searchr7�closer!�groupr�OSError)r'�ms  r(�_get_system_versionrOVs�������
	F��G�RY�Z�Z�Z�A�
��I�8�9:�����C�C�����	�	�	�	�����	�	�	�	�����}�"%�(�(�1�7�7�1�:�:�+;�+;�C�+@�+@��!��+D�"E�"E�����	�	�	�
�D�	�����s�B8�'A�A/�8
C�Cc��t�Pt��}|r@	td�|�d��D����an#t$rdaYnwxYwtS)z}
    Return the macOS system version as a tuple

    The return value is safe to use to compare
    two version numbers.
    Nc3�4K�|]}t|��V��dS�N��int��.0�is  r(�	<genexpr>z,_get_system_version_tuple.<locals>.<genexpr>�s(����-U�-U��c�!�f�f�-U�-U�-U�-U�-U�-Ur*rE�)�_SYSTEM_VERSION_TUPLErO�tupler�
ValueError��osx_versions r(�_get_system_version_tupler_us����$�)�+�+���	+�
+�(-�-U�-U�k�>O�>O�PS�>T�>T�-U�-U�-U�(U�(U�%�%���
+�
+�
+�(*�%�%�%�
+����!� s�,A�A�Ac�d�t|��D]}|�t��r||=� dS)z-Remove original unmodified values for testingN)�list�
startswith�_INITPRE)�_config_vars�ks  r(�_remove_original_valuesrf�sA���,�
�
� � ���<�<��!�!�	 ��Q��� � r*c�z�|�|d��}||krt|z|vr
||t|z<|||<dS)z@Save modified and original unmodified value of configuration varr@N)�getrc)rd�cv�newvalue�oldvalues    r(�_save_modified_valuerl�sP������B�'�'�H��H���8�b�=��#D�#D�&.��X��]�#��L����r*c�r�t�tSt|�d�d��}d}|���D]p}|�d��rd}�|�d��rd}�2|r<|���}|dkrda�Q|�d	��r
|dd
�a�qt�datS)z= Returns the root of the default SDK for this system, or '/' Nz -c -E -v - </dev/nullTFz#include <...>zEnd of search listz/usr/include�/z.sdk/usr/includei�)�_cache_default_sysrootr>�
splitlinesrbr9�endswith)�cc�contents�
in_incdirs�lines    r(�_default_sysrootrv�s����)�%�%��"�"�"�>��E�E�H��J��#�#�%�%�
4�
4���?�?�+�,�,�		4��J�J�
�_�_�1�
2�
2�	4��J�J�
�	4��:�:�<�<�D��~�%�%�),�&�&����1�2�2�
4�)-�d�s�d��&���%�!$��!�!r*c�L�t��}|rt|dk��ndS)z=Returns True if universal builds are supported on this system��
�F)r_�boolr]s r(�_supports_universal_buildsr|�s,��,�-�-�K�+6�A�4��w�&�'�'�'�E�Ar*c�2�t��}|r|dkndS)z9Returns True if arm64 builds are supported on this system)�rF)r_r]s r(�_supports_arm64_buildsr�s$��,�-�-�K�%0�;�;�'�!�!�e�;r*c��dtjvr|S|d���dx}}t|��st	d��}nntj�|���d��r<td|�	dd���d���}|rd|vrt	d��}|std	���||krjtD]b}||vr\|tjvrN||���}|d
kr|n|dz|d<t||d�
|�����c|S)
z7Find appropriate C compiler for extension module buildsr
r�clang�gccr,�'"'"'z' --versionzllvm-gcczCannot locate working compilerrz++� )rrrr)rBr�basenamerbr>�replace�SystemError�_COMPILER_CONFIG_VARSrlr!)rdrr�oldcc�datari�cv_splits      r(�_find_appropriate_compilerr��sr��"�r�z������d�#�)�)�+�+�A�.�.�B���B���+��g�
&�
&���	��	�	�"�	�	�	(�	(��	/�	/�+��|� "�
�
�3�	� :� :� :� :�=�>�>���	+�J�$�&�&�!�'�*�*�B�
�1��/�1�1�	1�
�U�{�{�(�	K�	K�B��\�!�!�b��
�&:�&:�'��+�1�1�3�3��$&�%�K�K�b�b�R�$�Y����$�\�2�s�x�x��7I�7I�J�J�J���r*c���tD]e}||vr_|tjvrQ||}tjdd|tj���}tjdd|��}t
|||���f|S)z5Remove all universal build arguments from config vars�
-arch\s+\w+\sr�)�flagsz-isysroot\s*\S+)�_UNIVERSAL_CONFIG_VARSrrrI�sub�ASCIIrl)rdrir�s   r(�_remove_universal_flagsr�s|��%�:�:��
����"�B�J�"6�"6� ��$�E��F�+�S�%�r�x�H�H�H�E��F�-�s�E�:�:�E� ��r�5�9�9�9���r*c�Z�dtjvr|Stjd|d���tjd|d�dd���d���}|rKtD]C}||vr=|tjvr/||}tjd	d
|��}t|||���D|S)z-Remove any unsupported archs from config varsr
z-arch\s+ppcrNzecho 'int main{};' | 'r,r�z6' -c -arch ppc -x c -o /dev/null /dev/null 2>/dev/nullz-arch\s+ppc\w*\sr�)	rrrIrJr6r�r�r�rl)rd�statusrir�s    r(�_remove_unsupported_archsr�s����r�z�����	�y���h�!7�8�8�D�����4� �(�(��i�8�8�8�8�
;�<�<���
	B�-�
B�
B����%�%�"�B�J�*>�*>�(��,�E��F�#6��U�C�C�E�(��r�5�A�A�A���r*c���dtjvratjd}tD]G}||vrAd||vr7||}tjdd|��}|dz|z}t|||���H|S)z2Allow override of all archs with ARCHFLAGS env var�	ARCHFLAGS�-archr�r�)rrr�rIr�rl)rd�archrir�s    r(�_override_all_archsr�:s���
�b�j� � ��z�+�&��(�	>�	>�B��\�!�!�g��b�1A�&A�&A�$�R�(����/��e�<�<�����d�*��$�\�2�u�=�=�=���r*c�^�|�dd��}tjd|��}|�|�d��}tj�|��sKtD]C}||vr=|tjvr/||}tj	dd|��}t|||���D|S)z+Remove references to any SDKs not availablerr@z-isysroot\s*(\S+)NrFz-isysroot\s*\S+(?:\s|$)r�)rhrIrJrLrr�existsr�rr�rl)rd�cflagsrN�sdkrir�s      r(�_check_for_unavailable_sdkr�Ks����
�
�h��
+�
+�F�
�	�&��/�/�A��}��g�g�a�j�j���w�~�~�c�"�"�	B�,�
B�
B����%�%�"�B�J�*>�*>�(��,�E��F�#=�s�E�J�J�E�(��r�5�A�A�A���r*c��dx}}t|��}t��sdx}}nd|v}td�|D����}|sdtjvr2		|�d��}|||dz�=n#t$rYnwxYw�0n]t��sOttt|������D]%}||dkr||dzdkr|||dz�=�&dtjvr)|s'|tjd���z}|rC	d	�t|��D��}|sn&|d
}||dkr	|||dz�=n|||dz�=�Bd}|}d
�t|��D��}|s|}d�t|��D��}|D]8}||dkr
||dz}n||td��d�}|rtj
�|��s`tj�d|�d���tj�d��tj���|S)ae
    This function will strip '-isysroot PATH' and '-arch ARCH' from the
    compile flags if the user has specified one them in extra_compile_flags.

    This is needed because '-arch ARCH' adds another architecture to the
    build, without a way to remove an architecture. Furthermore GCC will
    barf if multiple '-isysroot' arguments are present.
    FTr�c3�DK�|]}|�d���|V��dS)�	-isysrootN�rb)rV�args  r(rXz!compiler_fixup.<locals>.<genexpr>ys3����Q�Q�3�S�^�^�K�5P�5P�Q�3�Q�Q�Q�Q�Q�Qr*r�rGrF�arm64c�B�g|]\}}|�d���|��S�r�r��rVrW�xs   r(�
<listcomp>z"compiler_fixup.<locals>.<listcomp>�s-��X�X�X�S�Q�q�a�l�l�;�>W�>W�X�q�X�X�Xr*rr�Nc�B�g|]\}}|�d���|��Sr�r�r�s   r(r�z"compiler_fixup.<locals>.<listcomp>�s-��L�L�L�S�Q�q�!�,�,�{�2K�2K�L�q�L�L�Lr*c�B�g|]\}}|�d���|��Sr�r�r�s   r(r�z"compiler_fixup.<locals>.<listcomp>�s-��T�T�T���1�!�,�,�{�:S�:S�T�1�T�T�Tr*z2Compiling with an SDK that doesn't seem to exist: �
z%Please check your Xcode installation
)rar|�anyrr�indexr\r�reversed�range�lenr�	enumerater�isdirr�stderr�write�flush)	�compiler_so�cc_args�	stripArch�stripSysrootr��idx�indices�sysroot�argvars	         r(rrfs��� %�$�I���{�#�#�K�%�'�'�R�$(�'�	�L�L��w�&�	��Q�Q�'�Q�Q�Q�Q�Q���
+�K�2�:�-�-�	�
�#�)�)�'�2�2����e�A�g�
�.�.���
�
�
���
����	��
#�
%�
%�+��E�#�k�"2�"2�3�3�4�4�	+�	+�C��3��7�*�*�{�3�q�5�/A�W�/L�/L���C��E�	�*���b�j� � �� �"�B�J�{�$;�$A�$A�$C�$C�C���/�
	/�X�X�I�k�$:�$:�X�X�X�G��
���A�J�E��5�!�[�0�0���e�A�g�
�.�.� ��e�A�g�
�.�
	/��G�
�F�L�L�I�g�.�.�L�L�L�G��U���T�T�	�+� 6� 6�T�T�T�������#�;�+�%�%��S��U�m�G��E��S�k�#�k�"2�"2�"3�"3�4�G����r�w�}�}�W�-�-���
���Y�g�Y�Y�Y�Z�Z�Z��
���A�B�B�B��
�������s�A4�4
B�Bc�|�t��st|��t|��t|��|S)a�Customize Python build configuration variables.

    Called internally from sysconfig with a mutable mapping
    containing name/value pairs parsed from the configured
    makefile used to build this interpreter.  Returns
    the mapping updated as needed to reflect the environment
    in which the interpreter is running; in the case of
    a Python from a binary installer, the installed
    environment may be very different from the build
    environment, i.e. different OS levels, different
    built tools, different available CPU architectures.

    This customization is performed whenever
    distutils.sysconfig.get_config_vars() is first
    called.  It may be used in environments where no
    compilers are present, i.e. when installing pure
    Python dists.  Customization of compiler paths
    and detection of unavailable archs is deferred
    until the first extension module build is
    requested (in distutils.sysconfig.customize_compiler).

    Currently called from distutils.sysconfig
    )r|r�r�r��rds r(rr�sH��2&�'�'�.�
	 ��-�-�-���%�%�%��|�,�,�,��r*c�`�t|��t|��t|��|S)z�Customize compiler path and configuration variables.

    This customization is performed when the first
    extension module build is requested
    in distutils.sysconfig.customize_compiler.
    )r�r�r�r�s r(rr�s8���|�,�,�,��l�+�+�+���%�%�%��r*c�d�|�dd��}|r	d|vr|dz
}t��p|}|p|}|�rt|}d}|�tdz|�dd����}|rH	td�|�d��dd	�D����}n#t
$rd
}YnwxYwd
}|dkr�d|���vr�d
}tjd|��}ttt|������}t|��dkr	|d}nz|dkrd}nq|dkrd
}nh|dkrd}n_|dkrd}nV|dkrd}nM|dkrd}nDtd|�����|dkrtj
dkrd}n|dvrtj
dkrd }nd!}|||fS)"z Filter values for get_platform()�MACOSX_DEPLOYMENT_TARGETr@rEz.0�macosxrc3�4K�|]}t|��V��dSrRrSrUs  r(rXz#get_platform_osx.<locals>.<genexpr>s(����"N�"N�a�3�q�6�6�"N�"N�"N�"N�"N�"Nr*rrG)ry�rxr��fatz
-arch\s+(\S+)rF)r��x86_64�
universal2)�i386�ppc)r�r��intel)r�r�r��fat3)�ppc64r��fat64)r�r�r�r��	universalz#Don't know machine value for archs=r�lr�)�PowerPC�Power_Macintoshr�r�)rhrOrcr[rr\r9rI�findall�sorted�setr�r�maxsize)rd�osname�release�machine�macver�
macreleaser��archss        r(rr�sT���
�
�8�"�
=�
=�F�
��#�V�#�#�	�$���$�&�&�0�&�J�
�
!�z�F�
�; ������!�!�(�8�"3�$0�$4�$4�X�r�$B�$B�D�D���	!�
%�"�"N�"N�:�3C�3C�C�3H�3H��1��3M�"N�"N�"N�N�N�
�
���
%�
%�
%�$�
�
�
�
%����!�J��'�!�!�w�&�,�,�.�.�'@�'@��G��J�/��8�8�E��&��U���,�,�-�-�E��5�z�z�Q�����(����-�-�-�&����/�)�)�����,�,�,�!����3�3�3� ����-�-�-�!����<�<�<�%��� �j�>C�e�E�G�G�G���
�
��{�e�#�#�"���
�6�
6�
6��{�e�#�#�!������G�W�%�%s�24B'�'B6�5B6rR)F)�__doc__rrIr�__all__r�r�rcr)r>rBrHrOrZr_rfrlrorvr|rr�r�r�r�r�rrrrrYr*r(�<module>r�s���$�$�	�	�	�	�	�	�	�	�
�
�
�
�����A��?��#������4Q�Q�Q�Q�,��������<��!�!�!�& � � � � � ���"�"�"�2B�B�B�<�<�<�;�;�;�|���%�%�%�P���"���6M�M�M�`&�&�&�R���(P&�P&�P&�P&�P&r*

Zerion Mini Shell 1.0