U
    nvg                     @   s   d Z ddlZdZe Zg ZG dd dZG dd dejZdd Zee Ze	 Z
ed	e
f ed
e
dd e	  ede dS )a  
If we have a run callable passed to the constructor or set as an
attribute, but we don't actually use that (because ``__getattribute__``
or the like interferes), then when we clear callable before beginning
to run, there's an opportunity for Python code to run.

    Nc                   @   s   e Zd Zdd ZdS )RunCallablec                 C   s   t d td d S )N)r   __del__zfrom RunCallable)resultsappendmainswitch)self r	   M/tmp/pip-unpacked-wheel-49pzfzc0/greenlet/tests/fail_clearing_run_switches.pyr      s    
zRunCallable.__del__N)__name__
__module____qualname__r   r	   r	   r	   r
   r      s   r   c                   @   s   e Zd Zdd ZdS )Gc                 C   s"   |dkrt d tS t| |S )Nrun)G.__getattribute__r   )r   r   run_funcobject__getattribute__)r   namer	   r	   r
   r      s    
r   N)r   r   r   r   r	   r	   r	   r
   r      s   r   c                   C   s   t d d S )N)r   Zenter)r   r   r	   r	   r	   r
   r       s    r   zmain: g.switch()zIn main withT)flushZRESULTS)__doc__ZgreenletgZ
getcurrentr   r   r   r   r   r   xr   printr	   r	   r	   r
   <module>   s   	
