%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/keyring/testing/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/keyring/testing/__pycache__/util.cpython-312.pyc

�

�e~���ddlZddlZddlZddlZddlZGd�d�Zejd��Zd�ZejejzZefd�Zy)�Nc�0�eZdZdZd�Zdd�Zd�Zd�Zd�Zy)	�ImportKillerz@Context manager to make an import of a given name or names fail.c��||_y�N��names)�selfrs  �6/usr/lib/python3/dist-packages/keyring/testing/util.py�__init__zImportKiller.__init__s	����
�Nc�$�||jvr|Syrr)r	�fullname�paths   r
�find_modulezImportKiller.find_modules���t�z�z�!��K�"rc�8�||jvsJ�t|��r)r�ImportError)r	rs  r
�load_modulezImportKiller.load_modules���4�:�:�%�%�%��(�#�#rc���i|_|jD]/}tjj	|d�|j|<�1tj
j
d|�y)Nr)�originalr�sys�modules�pop�	meta_path�insert)r	�names  r
�	__enter__zImportKiller.__enter__sM����
��J�J�	>�D�"%�+�+�/�/�$��"=�D�M�M�$��	>��
�
���Q��%rc��tjj|�|jj	�D]\}}|��	|tj
|<�yr)rr�remover�itemsr)r	�args�key�values    r
�__exit__zImportKiller.__exit__sH���
�
���T�"��-�-�-�-�/�	)�J�C��� �#(����C� �	)rr)	�__name__�
__module__�__qualname__�__doc__rrrrr#�rr
rrs��F���$�&�)rrc+��K�i}|j�D])\}}|j|�||<|�	||vs�!||=�%|||<�+d��|j�D]\}}|�	||vs�
||=�|||<�y�w)z�Helper context manager to make and unmake changes to a dict.

    A None is not a valid value for the destination, and so means that the
    associated name should be removed.N)r�get)�destination�changesrr!r"s     r
�NoNoneDictMutatorr-#s������H��m�m�o�%�
��U�#����,���
��=��k�!���$�$�K���
%�
��n�n�&�%�
��U��=��k�!���$�$�K���%�s�3A.�+A.�"A.c�6�ttjfi|��S)z6A context manager to temporarily change the os.environ)r-�os�environ)r,s r
�Environr1:s���R�Z�Z�3�7�3�3rc�\�d}td|�D]}|tj|�z
}�|S)z-Generate a random string with length <i>k</i>�r)�range�random�choice)�k�source�result�is    r
�
random_stringr;Bs4��
�F�
�1�a�[�(���&�-�-��'�'��(��Mr)
�
contextlibr/rr5�stringr�contextmanagerr-r1�
ascii_letters�digits�ALPHABETr;r(rr
�<module>rBs]���	�
�
�
�)�)�6���%��%�,4�
���&�-�-�/��%�r

Zerion Mini Shell 1.0