a
    Ò�éiÙ  ã                   @   s¢   d Z ddlZddlZddlmZ edƒ dd„ Zejd Zze	eeƒZ
W n@ eyˆ   eejkrfeZ
nedkr‚e ej¡ZejZ
n‚ Y n0 ed	e
d
d� e
ƒ  dS )z“
Helper for testing a C++ exception throw aborts the process.

Takes one argument, the name of the function in :mod:`_test_extension_cpp` to call.
é    N)Ú_test_extension_cppzfail_cpp_exception is runningc                  C   s   dd„ } t   | ¡}| ¡  d S )Nc                   S   s   t  t j¡ d S )N)r   Z"test_exception_switch_and_do_in_g2Ztest_exception_throw_nonstd© r   r   úQ/home/Claro/venv/lib/python3.9/site-packages/greenlet/tests/fail_cpp_exception.pyÚ_   s    ÿz5run_unhandled_exception_in_greenlet_aborts.<locals>._)ÚgreenletÚswitch)r   Zg1r   r   r   Ú*run_unhandled_exception_in_greenlet_aborts   s    
r   é   Zrun_as_greenlet_targetZraisingT)Úflush)Ú__doc__Úsysr   Zgreenlet.testsr   Úprintr   ÚargvÚ	func_nameÚgetattrÚfuncÚAttributeErrorÚ__name__Ztest_exception_throw_stdÚgr   r   r   r   r   Ú<module>   s"   	

