
    zIf                     $    d dl Z d dlZd ZddZdS )    Nc                 :   h | dd} 	 d t          j        d          D             }nE# t          $ r8 ddl}|                    |j                  d         }h t          |          }Y nw xY w|| z
  D ]'}	 t          j        |           # t          $ r Y $w xY wdS )z8Close all the file descriptors except those in keep_fds.      c                 ,    h | ]}t          |          S  )int).0fds     [/var/www/piapp/venv/lib/python3.11/site-packages/joblib/externals/loky/backend/fork_exec.py	<setcomp>zclose_fds.<locals>.<setcomp>   s    BBBCGGBBB    z/proc/self/fdr   N)	oslistdirFileNotFoundErrorresource	getrlimitRLIMIT_NOFILErangecloseOSError)keep_fdsopen_fdsr   max_nfdsis        r   	close_fdsr      s     ! 1 a H&BBbj&A&ABBB & & &%%h&<==a@%U8__%	&    	HQKKKK 	 	 	D	 s!   ) ?A+*A+6B
BBc                     |pi }i t           j        |}t          j                    }|dk    r1t          |           t          j        t
          j        | |           d S |S )Nr   )r   environforkr   execvesys
executable)cmdr   env	child_envpids        r   	fork_execr&   !   s_    
)C%2:%%I
'))C
axx(
	#.#y11111
r   )N)r   r    r   r&   r   r   r   <module>r'      sF    
			 



  ,
 
 
 
 
 
r   