Hacked By AnonymousFox

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

�

�܋f=���ddlmZddlZddlZddlZddlmZmZddlmZddl	m
Z
ddlmZej
dd���Zej
	ddd���Zej
	dd d���Zej
	dd!d���Zd"d#d�ZdS)$�)�annotationsN)�	Generator�Iterator)�copy)�Path)�TextIO�outr�return�Iterator[None]c#�K�|xt_t_	dV�tjt_tjt_dS#tjt_tjt_wxYw)z+Patch and subsequently reset a text stream.N)�sys�stderr�stdout�
__stderr__�
__stdout__)r	s �g/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint/testutils/utils.py�_patch_streamsrs[����"�!�C�J���$�
�����^��
��^��
�
�
���^��
��^��
�#�#�#�#s�A�.A<�replacement_sys_path�list[str] | None�Generator[None, None, None]c#�K�tj}	|�t|��t_dV�|t_dS#|t_wxYw�N)r
�pathr)r�
original_paths  r�_test_sys_pathrsQ�����H�M�!��+��0�1�1�C�H�
���� ������=��� � � � s	�=�A�current_working_directory�str | Path | Nonec#�K�tj��}	|�tj|��dV�tj|��dS#tj|��wxYwr)�os�getcwd�chdir)r�original_dirs  r�	_test_cwdr#(sd�����9�;�;�L��$�0��H�.�/�/�/�
����
������������������s�A�A�new_pythonpath�
str | Nonec#�\K�tj�d��}|r|tjd<n|�|�
tjd=	dV�|�|tjd<dSdtjvrtjd=dSdS#|�|tjd<ndtjvr
tjd=wxYw)N�
PYTHONPATH)r�environ�get)r$�original_pythonpaths  r�_test_environ_pythonpathr+5s������*�.�.��6�6���%�#1��
�<� � �	�	�$7�$C��J�|�$�)�
�����*�':�B�J�|�$�$�$�
�R�Z�
'�
'��
�<�(�(�(�(�
'���*�':�B�J�|�$�$�
�R�Z�
'�
'��
�<�(�(�(�(�(s�A<�</B+�.�paths�	list[str]�chroot�str�Nonec�T�t��t��}}|D]�}tj�||��}tj�|��}|s|�|���Y|�tj�|����|�|����|D]5}tj�|��stj|���6|D]-}t|dd���5	ddd��n#1swxYwY�.dS)a�Creates directories and files found in <path>.

    :param list paths: list of relative paths to files or directories
    :param str chroot: the root directory in which paths will be created

    >>> from os.path import isdir, isfile
    >>> isdir('/tmp/a')
    False
    >>> create_files(['a/b/foo.py', 'a/b/c/', 'a/b/c/d/e.py'], '/tmp')
    >>> isdir('/tmp/a')
    True
    >>> isdir('/tmp/a/b/c')
    True
    >>> isfile('/tmp/a/b/c/d/e.py')
    True
    >>> isfile('/tmp/a/b/foo.py')
    True
    �wzutf-8)�encodingN)
�setrr�join�basename�add�dirname�isdir�makedirs�open)r-r/�dirs�filesr�filename�dirpath�filepaths        r�create_filesrBHsW��&�%�%����%�D��	�	���w�|�|�F�D�)�)���7�#�#�D�)�)���	��H�H�T�N�N�N�N�
�H�H�R�W�_�_�T�*�*�+�+�+��I�I�d�O�O�O�O��!�!���w�}�}�W�%�%�	!��K�� � � ������
�(�C�'�
2�
2�
2�	�	��	�	�	�	�	�	�	�	�	�	�	����	�	�	�	���s�D�D 	�#D 	)r	rr
rr)rrr
r)rrr
r)r$r%r
r)r,)r-r.r/r0r
r1)�
__future__r�
contextlibrr
�collections.abcrrr�pathlibr�typingr�contextmanagerrrr#r+rB��r�<module>rKsP��
#�"�"�"�"�"�����	�	�	�	�
�
�
�
�/�/�/�/�/�/�/�/���������������������$�$�$���$���-1�	!�	!�	!�	!���	!���37�	�	�	�	���	���!%�)�)�)�)���)�$#�#�#�#�#�#�#rJ

Hacked By AnonymousFox1.0, Coded By AnonymousFox