AlkantarClanX12

Your IP : 3.147.47.177


Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/setuptools/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/setuptools/__pycache__/sandbox.cpython-311.pyc

�

�܋f�9��T�ddlmZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlmZddl
mZej�d��rddlmcmcmcmZnejejZ	eZn
#e$rdZYnwxYweZgd�Zd!d�Z e	j!d!d���Z"e	j!d	���Z#e	j!d
���Z$e	j!d���Z%Gd�d
e&��Z'Gd�d��Z(e	j!d���Z)d�Z*e	j!d���Z+e	j!d���Z,hd�Z-d�Z.d�Z/d�Z0Gd�d��Z1e2ed��r	ej3gZ4ngZ4Gd�de1��Z5ej6ej7d�d�8��D����Z9Gd�d e��Z:dS)"�)�annotationsN)�DistutilsError)�working_set�java)�AbstractSandbox�DirectorySandbox�SandboxViolation�	run_setupc���d}t||��5}|���}ddd��n#1swxYwY|�|}t||d��}t|||��dS)z.
    Python 3 implementation of execfile.
    �rbN�exec)�open�read�compiler
)�filename�globals�locals�mode�stream�script�codes       �c/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/setuptools/sandbox.py�	_execfiler&s����D�	
�h��	�	���������������������������
�~����6�8�V�,�,�D���w������s�4�8�8c#�K�tjdd�}|�|tjdd�<	|V�|tjdd�<dS#|tjdd�<wxYw�N)�sys�argv)�repl�saveds  r�	save_argvr 3sf�����H�Q�Q�Q�K�E�������������������������e����������s�A�Ac#�K�tjdd�}	|V�|tjdd�<dS#|tjdd�<wxYwr)r�path�rs r�	save_pathr$>sQ�����H�Q�Q�Q�K�E����������������e����������s	�/�Ac#�K�tj|d���tj}|t_	dV�|t_dS#|t_wxYw)zL
    Monkey-patch tempfile.tempdir with replacement, ensuring it exists
    T)�exist_okN)�os�makedirs�tempfile�tempdir)�replacementrs  r�
override_tempr,Gs]����
�K��d�+�+�+�+���E�"�H��!�
���� ������5��� � � � s�A�Ac#�K�tj��}tj|��	|V�tj|��dS#tj|��wxYwr)r'�getcwd�chdir)�targetrs  r�pushdr1XsR�����I�K�K�E��H�V���������
������������������s�A�Ac�(�eZdZdZed���ZdS)�UnpickleableExceptionzP
    An exception representing another Exception that could not be pickled.
    c	���	tj|��tj|��fS#t$r5ddlm}|�||t
|������cYSwxYw)z�
        Always return a dumped (pickled) type and exc. If exc can't be pickled,
        wrap it in UnpickleableException first.
        r)r3)�pickle�dumps�	Exception�setuptools.sandboxr3�dump�repr)�type�exc�clss   rr9zUnpickleableException.dumpgs{��	1��<��%�%�v�|�C�'8�'8�8�8���	1�	1�	1�G�G�G�G�G�G��8�8�C���T�#�Y�Y���0�0�0�0�0�		1���s�'*�<A)�(A)N)�__name__�
__module__�__qualname__�__doc__�staticmethodr9��rr3r3bs9���������1�1��\�1�1�1rDr3c�$�eZdZdZd�Zd�Zd�ZdS)�ExceptionSaverz]
    A Context Manager that will save an exception, serialize, and restore it
    later.
    c��|SrrC��selfs r�	__enter__zExceptionSaver.__enter__|s���rDc�\�|sdSt�||��|_||_dS)NFT)r3r9�_saved�_tb)rIr;r<�tbs    r�__exit__zExceptionSaver.__exit__s6���	��5�,�0�0��s�;�;�������trDc��dt|��vrdSttj|j��\}}|�|j���)z"restore and re-raise any exceptionrLN)�vars�mapr5�loadsrL�with_tracebackrM)rIr;r<s   r�resumezExceptionSaver.resume�sG���4��:�:�%�%��F����d�k�2�2�	��c�� � ���*�*�*rDN)r>r?r@rArJrOrUrCrDrrFrFvsK��������
���	�	�	�+�+�+�+�+rDrFc#�P�K�tj����t��5}�V�ddd��n#1swxYwYtj�����fd�tjD��}t|��|���dS)z�
    Context in which imported modules are saved.

    Translates exceptions internal to the context into the equivalent exception
    outside the context.
    Nc3�N�K�|]}|�v�|�d���|V�� dS)z
encodings.N��
startswith)�.0�mod_namers  �r�	<genexpr>zsave_modules.<locals>.<genexpr>�sP���������5� � ��#�#�L�1�1�!�	� � � � ��rD)r�modules�copyrF�update�_clear_modulesrU)�	saved_exc�del_modulesrs  @r�save_modulesrc�s������
�K�����E�	�	�	��Y������������������������K���u�������������K��;����
�������s�A�A�Ac�D�t|��D]}tj|=�dSr)�listrr])�module_namesr[s  rr`r`�s0����&�&�"�"���K��!�!�"�"rDc#�K�tj��}	|V�tj|��dS#tj|��wxYwr)�
pkg_resources�__getstate__�__setstate__r#s r�save_pkg_resources_staterk�sP�����&�(�(�E�*������"�5�)�)�)�)�)��
�"�5�)�)�)�)���s	�1�Ac#�ZK�tj�|d��}t��5t	��5t��5t
��t��5t|��5t|��5td��dV�ddd��n#1swxYwYddd��n#1swxYwYddd��n#1swxYwYddd��n#1swxYwYddd��n#1swxYwYddd��dS#1swxYwYdS)N�temp�
setuptools)r'r"�joinrkrcr$�hide_setuptoolsr r,r1�
__import__)�	setup_dir�temp_dirs  r�
setup_contextrt�s������w�|�|�I�v�.�.�H�	!�	#�	#�	"�	"�
�^�^�	"�	"����
"�
"��!�!�!��[�[�"�"�&�x�0�0�"�"�"�9�-�-�"�"�&�|�4�4�4�!�E�E�E�"�"�"�"�"�"�"�"�"�"�"����"�"�"�"�"�"�"�"�"�"�"�"�"�"�"����"�"�"�"�"�"�"�"�"�"�"�"�"�"�"����"�"�"�"�
"�
"�
"�
"�
"�
"�
"�
"�
"�
"�
"����
"�
"�
"�
"�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"����	"�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"����	"�	"�	"�	"�	"�	"s��D �D�C1�,C	�<C�B,
� C�,B0�0C�3B0�4C�7C	�C�C	�
C�C	�C1�C
�C1�!C
�"C1�%D�1C5�5D�8C5�9D�<D �D	�D �D	�D � D$�'D$>�Cython�	distutilsrnrh�_distutils_hackc�L�|�dd��d}|tvS)aH
    >>> _needs_hiding('setuptools')
    True
    >>> _needs_hiding('pkg_resources')
    True
    >>> _needs_hiding('setuptools_plugin')
    False
    >>> _needs_hiding('setuptools.__init__')
    True
    >>> _needs_hiding('distutils')
    True
    >>> _needs_hiding('os')
    False
    >>> _needs_hiding('Cython')
    True
    �.�r)�split�_MODULES_TO_HIDE)r[�base_modules  r�
_needs_hidingr~�s(��"�.�.��a�(�(��+�K��*�*�*rDc���tj�dd��}|�|���t	t
tj��}t
|��dS)a%
    Remove references to setuptools' modules from sys.modules to allow the
    invocation to import the most appropriate setuptools. This technique is
    necessary to avoid issues such as #315 where setuptools upgrading itself
    would fail to find a function declared in the metadata.
    rwN)rr]�get�_remove_shim�filterr~r`)rwr]s  rrprp�sW���k�o�o�&7��>�>�O��"��$�$�&�&�&��]�C�K�0�0�G��7�����rDc��tj�tj�|����}t	|��5	|gt|��ztjdd�<tj�d|��tj
��tj�d���t|��5t|d���}t||��ddd��n#1swxYwYn,#t $r}|jr|jdr�Yd}~nd}~wwxYwddd��dS#1swxYwYdS)z8Run a distutils setup script, sandboxed in its directoryNrc�*�|���Sr)�activate)�dists r�<lambda>zrun_setup.<locals>.<lambda>s��d�m�m�o�o�rD�__main__)�__file__r>)r'r"�abspath�dirnamertrerr�insertr�__init__�	callbacks�appendr�dictr�
SystemExit�args)�setup_scriptr�rr�ns�vs     rr
r
�s������������ =� =�>�>�I�	�y�	!�	!�
�
�	�'�.�4��:�:�5�C�H�Q�Q�Q�K��H�O�O�A�y�)�)�)�� �"�"�"��!�(�(�)E�)E�F�F�F�!�)�,�,�
,�
,��<�*�E�E�E���,��+�+�+�
,�
,�
,�
,�
,�
,�
,�
,�
,�
,�
,����
,�
,�
,�
,����	�	�	��v�
�!�&��)�
�����������	����
�
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�
�
sa�E�BD�"D�4D�D	�D�D	�D�E�
D5�D0�+E�0D5�5E�E	�E	c���eZdZdZdZd�Zd�Zd�Zd�Zd�Z	dd
�Z
dD]$Zee
e��re
e��e��e<�%ddd
�Zerede��Zede��ZdD]$Zee
e��ree��e��e<�%dd�ZdD]$Zee
e��ree��e��e<�%dd�ZdD]$Zee
e��ree��e��e<�%d�Zd�Zd�Zd�ZdS)rzDWrap 'os' module and 'open()' builtin for virtualizing setup scriptsFc�R���fd�tt��D���_dS)Nc�^��g|])}|�d���t�|���'|��*S)�_)rY�hasattr)rZ�namerIs  �r�
<listcomp>z,AbstractSandbox.__init__.<locals>.<listcomp>sO���
�
�
���?�?�3�'�'�
�-4�D�$�,?�,?�
��
�
�
rD)�dir�_os�_attrsrHs`rr�zAbstractSandbox.__init__s7���
�
�
�
��C���
�
�
����rDc	�b�|jD]&}tt|t||�����'dSr)r��setattrr'�getattr)rI�sourcer�s   r�_copyzAbstractSandbox._copys<���K�	5�	5�D��B��g�f�d�3�3�4�4�4�4�	5�	5rDc��|�|��tr|jt_|jt_d|_dS)NT)r��_file�builtins�file�_openr�_activerHs rrJzAbstractSandbox.__enter__s9���
�
�4�����	'� �J�H�M��
��
�����rDc��d|_trtt_tt_|�t��dS�NF)r�r�r�r�r�rr�r�)rI�exc_type�	exc_value�	tracebacks    rrOzAbstractSandbox.__exit__#s2������	"�!�H�M���
��
�
�3�����rDc�N�|5|��cddd��S#1swxYwYdS)zRun 'func' under os sandboxingNrC)rI�funcs  r�runzAbstractSandbox.run*su��
�	�	��4�6�6�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�
��r��strc�@���tt������fd�}|S)Nc�X��|jr|j�||g|�Ri|��\}}�||g|�Ri|��Sr)r��_remap_pair)rI�src�dstr��kwr��originals     ��r�wrapz3AbstractSandbox._mk_dual_path_wrapper.<locals>.wrap2sZ����|�
I�+�4�+�D�#�s�H�T�H�H�H�R�H�H���S��8�C��2�t�2�2�2�r�2�2�2rD�r�r��r�r�r�s` @r�_mk_dual_path_wrapperz%AbstractSandbox._mk_dual_path_wrapper/s8�����3��%�%��	3�	3�	3�	3�	3�	3�
�rD)�rename�link�symlinkNc�D����ptt������fd�}|S)Nc�N��|jr|j�|g|�Ri|��}�|g|�Ri|��Sr)r��_remap_input�rIr"r�r�r�r�s    ��rr�z5AbstractSandbox._mk_single_path_wrapper.<locals>.wrap@sR����|�
B�(�t�(��t�A�d�A�A�A�b�A�A���8�D�.�4�.�.�.�2�.�.�.rDr�)r�r�r�s`` r�_mk_single_path_wrapperz'AbstractSandbox._mk_single_path_wrapper=s=�����1�w�s�D�1�1��	/�	/�	/�	/�	/�	/�
�rDr�r)�stat�listdirr/r�chmod�chown�mkdir�remove�unlink�rmdir�utime�lchown�chroot�lstat�	startfile�mkfifo�mknod�pathconf�accessc�@���tt������fd�}|S)Nc���|jr2|j�|g|�Ri|��}|���|g|�Ri|����S�|g|�Ri|��Sr)r�r��
_remap_outputr�s    ��rr�z4AbstractSandbox._mk_single_with_return.<locals>.wrapes�����|�
M�(�t�(��t�A�d�A�A�A�b�A�A���)�)�$����0K��0K�0K�0K��0K�0K�L�L�L��8�D�.�4�.�.�.�2�.�.�.rDr�r�s` @r�_mk_single_with_returnz&AbstractSandbox._mk_single_with_returnbs8�����3��%�%��	/�	/�	/�	/�	/�	/��rD)�readlink�tempnamc�@���tt������fd�}|S)Nc�R���|i|��}|jr|��|��S|Sr)r�r�)rIr�r��retvalr�r�s    ��rr�z'AbstractSandbox._mk_query.<locals>.wrapts<����X�t�*�r�*�*�F��|�
8��)�)�$��7�7�7��MrDr�r�s` @r�	_mk_queryzAbstractSandbox._mk_queryqs8�����3��%�%��	�	�	�	�	�	��rD)r.�tmpnamc��|S)z=Called to remap or validate any path, whether input or outputrC)rIr"s  r�_validate_pathzAbstractSandbox._validate_path�s���rDc�,�|�|��S�zCalled for path inputs�r��rI�	operationr"r�r�s     rr�zAbstractSandbox._remap_input�����"�"�4�(�(�(rDc�,�|�|��S)zCalled for path outputsr�)rIr�r"s   rr�zAbstractSandbox._remap_output�r�rDc�V�|j|dz|g|�Ri|��|j|dz|g|�Ri|��fS)�?Called for path pairs like rename, link, and symlink operationsz-fromz-to)r��rIr�r�r�r�r�s      rr�zAbstractSandbox._remap_pair�s\��
�D��i�'�1�3�D��D�D�D��D�D��D��i�%�/��B�t�B�B�B�r�B�B�
�	
rD)r�r�r)r>r?r@rAr�r�r�rJrOr�r��_AbstractSandbox__namer�r�rr�r�r�r�r�r�r�r�r�rCrDrrrs.������N�N��G�
�
�
�5�5�5����������
����0�=�=���7�3����	=�4�4�V�<�<�F�F�H�H�V��������
�7�'�'���6�6��#�#�F�E�2�2�E��?�?��*�7�3����	?�6�6�v�>�>�F�F�H�H�V���	�	�	�	�*�>�>���7�3����	>�5�5�f�=�=�F�F�H�H�V���	�	�	�	�'�1�1���7�3����	1�(�y��0�0�F�F�H�H�V������)�)�)�)�)�)�
�
�
�
�
rDr�devnullc��eZdZUdZe�gd���ZgZded<	e	fd�Z
d�Zerdd�Zdd	�Z
d
�Zd�Zd�Zd
�Zd�Zdd�ZdS)rz<Restrict operations to a single subdirectory - pseudo-chroot)
rr�r�r�r�r�r�r�r�r�r�r�r�zlist[str | re.Pattern]�_exception_patternsc�2�tj�tj�|����|_tj�|jd��|_d�|D��|_t�	|��dS)N�c��g|]>}tj�tj�|������?SrC)r'r"�normcase�realpath)rZr"s  rr�z-DirectorySandbox.__init__.<locals>.<listcomp>�sE��
�
�
�9=�B�G���R�W�-�-�d�3�3�4�4�
�
�
rD)
r'r"r�r��_sandboxro�_prefix�_exceptionsrr�)rI�sandbox�
exceptionss   rr�zDirectorySandbox.__init__�s����(�(���)9�)9�'�)B�)B�C�C��
��w�|�|�D�M�2�6�6���
�
�AK�
�
�
���	� � ��&�&�&�&�&rDc�(�ddlm}||||���)Nr)r	)r8r	)rIr�r�r�r	s     r�
_violationzDirectorySandbox._violation�s)��7�7�7�7�7�7���y�$��3�3�3rD�rc�|�|dvr(|�|��s|jd||g|�Ri|��t||g|�Ri|��S)N�r��rtr�rU�Ur�)�_okr�r��rIr"rr�r�s     rr�zDirectorySandbox._file�sc���7�7�7�������7������d�@�T�@�@�@�R�@�@�@���t�1�d�1�1�1�b�1�1�1rDc�|�|dvr(|�|��s|jd||g|�Ri|��t||g|�Ri|��S)Nrr)rr�r�rs     rr�zDirectorySandbox._open�sc���3�3�3�D�H�H�T�N�N�3��D�O�F�D�$�<��<�<�<��<�<�<��T�4�-�$�-�-�-�"�-�-�-rDc�0�|�d��dS)Nr�)r�rHs rr�zDirectorySandbox.tmpnam�s������!�!�!�!�!rDc�4�|j}	d|_tj�tj�|����}|�|��p$||jkp|�|j��	||_S#||_wxYwr�)	r�r'r"r�r��	_exemptedr�rYr�)rIr"�activer�s    rrzDirectorySandbox._ok�s������		"� �D�L��w�'�'���(8�(8��(>�(>�?�?�H����x�(�(�5��t�}�,�5��&�&�t�|�4�4�
�"�D�L�L��6�D�L�!�!�!�!s�A<B�	Bc����fd�|jD��}�fd�|jD��}tj||��}t	|��S)Nc3�B�K�|]}��|��V��dSrrX)rZ�	exception�filepaths  �rr\z-DirectorySandbox._exempted.<locals>.<genexpr>�sB�����
�
�/8�H���	�*�*�
�
�
�
�
�
rDc3�B�K�|]}tj|���V��dSr)�re�match)rZ�patternrs  �rr\z-DirectorySandbox._exempted.<locals>.<genexpr>�s@�����
�
�,3�B�H�W�h�'�'�
�
�
�
�
�
rD)r�r��	itertools�chain�any)rIr�
start_matches�pattern_matches�
candidatess `   rr
zDirectorySandbox._exempted�sx���
�
�
�
�<@�<L�
�
�
�
�
�
�
�
�7;�7O�
�
�
���_�]�O�D�D�
��:���rDc��||jvrD|�|��s/|j|tj�|��g|�Ri|��|Sr�)�	write_opsrr�r'r"r�r�s     rr�zDirectorySandbox._remap_input�sW�����&�&�t�x�x��~�~�&��D�O�I�r�w�'7�'7��'=�'=�K��K�K�K��K�K�K��rDc��|�|��r|�|��s|j|||g|�Ri|��||fS)r�)rr�r�s      rr�zDirectorySandbox._remap_pair�sU���x�x��}�}�	>�D�H�H�S�M�M�	>��D�O�I�s�C�=�$�=�=�=�"�=�=�=��S�z�rD�c��|tzr)|�|��s|jd|||g|�Ri|��tj|||g|�Ri|��S)zCalled for low-level os.open()zos.open)�WRITE_FLAGSrr�r�r)rIr��flagsrr�r�s      rrzDirectorySandbox.open�sn���;��	G�t�x�x��~�~�	G��D�O�I�t�U�D�F�4�F�F�F�2�F�F�F��x��e�T�7�D�7�7�7�B�7�7�7rDN)r�)r)r>r?r@rAr��fromkeysrr��__annotations__�_EXCEPTIONSr�r�r�r�r�rr
r�r�rrCrDrrr�s�������F�F��
�
������I� 35��4�4�4�4�4�+6�'�'�'�'�4�4�4�

�2�	2�	2�	2�	2�
.�.�.�.�
"�"�"�"�"�"����������8�8�8�8�8�8rDrc�:�g|]}tt|d����S)rr�)rZ�as  rr�r��s4�����
�	��Q������rDz4O_WRONLY O_RDWR O_APPEND O_CREAT O_TRUNC O_TEMPORARYc�\�eZdZdZejd�����Zd�ZdS)r	zEA setup script attempted to modify the filesystem outside the sandboxa
        SandboxViolation: {cmd}{args!r} {kwargs}

        The package setup script has attempted to modify files on your system
        that are not within the EasyInstall build area, and has been aborted.

        This package cannot be safely installed by EasyInstall, and may not
        support alternate installation locations even if you run its setup
        script by hand.  Please inform the package's author and the EasyInstall
        maintainers to find out if a fix or workaround is available.
        c�T�|j\}}}|jjdit����S)NrC)r��tmpl�formatr)rI�cmdr��kwargss    r�__str__zSandboxViolation.__str__s/�� �I���T�6��t�y��+�+�&�(�(�+�+�+rDN)	r>r?r@rA�textwrap�dedent�lstripr(r,rCrDrr	r	�sO������O�O��8�?�
	���
�f�h�h�	�,�,�,�,�,rDr	r);�
__future__rr'rr)�operator�	functoolsrr�
contextlibr5r-r�rh�distutils.errorsrr�platformrY�$org.python.modules.posix.PosixModule�pythonr]�posix�PosixModuler�r�r�r��	NameErrorrr��__all__r�contextmanagerr r$r,r1r7r3rFrcr`rkrtr|r~rpr
rr�r�r#r�reduce�or_r{rr	rCrDr�<module>r?s���"�"�"�"�"�"�	�	�	�	�
�
�
�
�����������������	�	�	�	�����
�
�
�
�������������+�+�+�+�+�+�%�%�%�%�%�%��<���6�"�"��6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�

�+�b�g�
�C���E�E�������E�E�E�����������
 �
 �
 �
 ������������������
!�
!���
!� �������1�1�1�1�1�I�1�1�1�(+�+�+�+�+�+�+�+�<�������2"�"�"�
��*�*���*���"�"���"�����+�+�+�*������(E
�E
�E
�E
�E
�E
�E
�E
�P�7�2�y�����:�,�K�K��K�Y8�Y8�Y8�Y8�Y8��Y8�Y8�Y8�x�i���L���G�M�M�O�O�������,�,�,�,�,�~�,�,�,�,�,s�B�B
�B