
    PhG                     <    e d       ZddlZ e d      ZddlmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZ ej                  Zg d	Z ee e       e ee      
       d Zej"                  Zd Zej&                  Zd Zd Zej,                  Zd Zej0                  ZddZy)os    Nsocket)greenio)	get_errno)greenthread)hubs)slurp_properties)fdopenreadwritewaitwaitpidopen)ignoresrckeysc                     t        | t              st        d| z        	 t        j                  | g|i |S # t
        $ r}t        |j                   d}~ww xY w)zrfdopen(fd [, mode='r' [, bufsize]]) -> file_object

    Return an open file object connected to a file descriptor.zfd should be int, not %rN)
isinstanceint	TypeErrorr   	GreenPipeIOErrorOSErrorargs)fdr   kwes       \C:\Users\daisl\Desktop\realtime-object-detection\venv\Lib\site-packages\eventlet/green/os.pyr
   r
      s^     b#2R788  1d1b11 qvvs   9 	AAAc                 f   	 	 t        | |      S # t        t        f$ r'}t        |      t        j
                  k7  r Y d}~n@d}~wt        j                  $ r'}t        |      t        j                  k(  rY d}~y d}~ww xY w	 t        j                  | d       n# t        j                  $ r Y yw xY w)z;read(fd, buffersize) -> string

    Read a file descriptor.TN )r   )__original_read__r   r   r   errnoEAGAINr   errorEPIPEr   
trampolineIOClosed)r   nr   s      r   r   r   #   s     	$R++! 	|u||+ ,|| 	|u{{*		OOBT*}} 		 s8    A=A  A=A87A88A=B B/.B/c                 0   	 	 t        | |      S # t        t        f$ r'}t        |      t        j
                  k7  r Y d}~n@d}~wt        j                  $ r'}t        |      t        j                  k7  r Y d}~nd}~ww xY wt        j                  | d       )zPwrite(fd, string) -> byteswritten

    Write a string to a file descriptor.
    TN)r   )__original_write__r   r   r   r!   r"   r   r#   r$   r   r%   )r   str   s      r   r   r   9   s    
 	%b"--! 	|u||+ ,|| 	|u{{* +	 	$' s     A=A  A=A88A=c                      t        dd      S )zDwait() -> (pid, status)

    Wait for completion of a child process.r   )r        r   r   r   J   s     1a=r-   c                     |t         j                  z  dk7  rt        | |      S |t         j                  z  }	 t        | |      \  }}|r	|dk\  r||fS t        j                  d       0)zjwaitpid(...)
    waitpid(pid, options) -> (pid, status)

    Wait for completion of a given child process.r   g{Gz?)os_origWNOHANG__original_waitpid__r   sleep)pidoptionsnew_optionsrpidstatuss        r   r   r   S   si    
  A%#C11//[ALD&!V|#d#	 r-   c                     t        |       j                  dk(  r|||df\  } }}}|t        | |||      }nt        | ||      }t        j                  |       |S )zt Wrap os.open
        This behaves identically, but collaborates with
        the hub's notify_opened protocol.
    _NormalAccessorN)dir_fd)type__name____original_open__r   notify_opened)fileflagsmoder:   r   s        r   r   r   e   se     Dz//$)4$=!eT6tUD@tUD1rIr-   )i  N)
__import__r/   r!   r   eventletr   eventlet.supportr   r   r   eventlet.patcherr	   __all____patched__globalsdirr
   r   r    r   r)   r   r   r1   r   r=   r,   r-   r   <module>rJ      s   
T
 	H	  &    -
//D IL		 LL & ]] ("  $ LL r-   