OwlCyberSecurity - MANAGER
Edit File: test_throw.cpython-312.pyc
� ʓ�g� � �@ � d dl Z d dlmZ ddlmZ d� Z G d� de� Zy)� N)�greenlet� )�TestCasec �X � t j � j j | � S )N)r � getcurrent�parent�switch)�argss �J/opt/hc_python/lib64/python3.12/site-packages/greenlet/tests/test_throw.pyr r s$ � �.�8��� �'�'�.�.��5�5� c �6 � e Zd Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z y) � ThrowTestsc � � d� }t |� }|j � }| j |d� |j t � }| j |d� y )Nc �f � t d� t d� y # t $ r t d� Y y w xY w�N�ok�fail)r �RuntimeError� r r �fz ThrowTests.test_class.<locals>.f s2 � � ��t�� �6�N�� � ��t��� �s � �0�0r �r r �assertEqual�throwr ��selfr �g�ress r � test_classzThrowTests.test_class sK � � � �Q�K���h�h�j������d�#��g�g�l�#������d�#r c �f � d� }t |� }|j � }| j |d� |j t d� � }| j |d� t |� }|j � }| j |d� |j t d� }| j |d� y )Nc � � t d� t d� y # t $ r5 t j � d } t | � dk( r t d� Y y Y �Iw xY w)Nr r �ciaor )r r �sys�exc_info�str)�vals r r zThrowTests.test_val.<locals>.f sS � � ��t�� �6�N�� � ��l�l�n�Q�'���s�8�v�%��4�L�� &� �s � �9A�Ar r! r r s r �test_valzThrowTests.test_val s� � � � �Q�K���h�h�j������d�#��g�g�l�6�*�+������d�#��Q�K���h�h�j������d�#��g�g�l�F�+������d�#r c �~ � d� }t |� }|j � }| j |d� |j � }| j t |t j � � | j |j � |j � }| j t |t j � � y )Nc �0 � t d� t d� y r �r r r r r zThrowTests.test_kill.<locals>.f2 s � ��4�L��6�Nr r )r r r r � assertTrue� isinstance�GreenletExit�deadr s r � test_killzThrowTests.test_kill1 s� � � � �Q�K���h�h�j������d�#��g�g�i����� �3��(=�(=�>�?���������g�g�i����� �3��(=�(=�>�?r c � �� t j � ��fd�}�fd�}t |� }t ||�� }| j t � 5 |j t � d d d � | j |j � | j |j � t |� }t ||�� }|j � }| j |d� |j t � }| j |d� | j |j � | j |j � t |� }t ||�� }|j � }| j |d� |j � }| j |d� |j t � }| j |d� | j |j � | j |j � y # 1 sw Y ���xY w)Nc �H �� � j d� y# t $ r Y yw xY w)N�f1 ready to catch�caughtznormal exit)r � IndexError��mains �r �f1z9ThrowTests.test_throw_goes_to_original_parent.<locals>.f1A s. �� � ����/�0� !�� � �� �s � � !�!c �( �� � j d� y )N�from f2r) r4 s �r �f2z9ThrowTests.test_throw_goes_to_original_parent.<locals>.f2H s �� ��K�K� �"r )r r1 r2 r8 ) r r �assertRaisesr3 r r* r- r r )r r6 r9 �g1�g2r r5 s @r �"test_throw_goes_to_original_parentz-ThrowTests.test_throw_goes_to_original_parent>