3
Z_ð]¨  ã               @   sŠ   d Z eZddlmZ ddlmZ ddlmZ ddl	Z	e
eƒZddgZeeeƒ ee
eƒd� ejƒ  eZG d	d„ deƒZeZd
add„ ZdS )zÿ
In order to detect a filehandle that's been closed, our only clue may be
the operating system returning the same filehandle in response to some
other  operation.

The builtins 'file' and 'open' are patched to collaborate with the
notify_opened protocol.
é    )Úhubs)Úhub)Úslurp_propertiesNÚfileÚopen)ÚignoreZsrckeysc                   s   e Zd Z‡ fdd„Z‡  ZS )r   c                s$   t t| ƒj||Ž tj| jƒ ƒ d S )N)Úsuperr   Ú__init__r   Únotify_openedÚfileno)ÚselfÚargsÚkwargs)Ú	__class__© ú:/tmp/pip-build-yz_zf6az/eventlet/eventlet/green/builtin.pyr	      s    zfile.__init__)Ú__name__Ú
__module__Ú__qualname__r	   Ú__classcell__r   r   )r   r   r      s   Fc              G   s&   t | Ž }ts"datj|jƒ ƒ da|S )NTF)Ú__original_openÚ	__openingr   r
   r   )r   Úresultr   r   r   r   %   s    )Ú__doc__Ú__builtins__Zbuiltins_origZeventletr   Zeventlet.hubsr   Zeventlet.patcherr   ÚsysÚdirÚ__all__Z__patched__ÚglobalsZget_hubr   Z__original_filer   r   r   r   r   r   r   Ú<module>   s   