o
    ?Hh                     @   sT   d dl Z d dlmZ d dlmZ G dd deZG dd deZG dd	 d	eZdS )
    N)assert_spawning)BaseProcessc                       s>   e Zd ZdZddddi dddf fdd	Zedd Z  ZS )	LokyProcesslokyN Fc	           	         s<   t  j||||||d |d u ri n|| _| j| _|| _d S )N)grouptargetnameargskwargsdaemon)super__init__envauthkeyinit_main_module)	selfr   r   r	   r
   r   r   r   r   	__class__r   e/home/air/sanwanet/gpt-api/venv/lib/python3.10/site-packages/joblib/externals/loky/backend/process.pyr      s   
zLokyProcess.__init__c                 C   s2   t jdkrddlm} || S ddlm} || S )Nwin32   )Popen)sysplatformpopen_loky_win32r   popen_loky_posix)process_objr   r   r   r   _Popen'   s
   
zLokyProcess._Popen)__name__
__module____qualname___start_methodr   staticmethodr   __classcell__r   r   r   r   r      s    r   c                       s.   e Zd ZdZddddi df fdd	Z  ZS )LokyInitMainProcessloky_init_mainNr   c              	      s   t  j||||||dd d S )NT)r   r   r	   r
   r   r   r   )r   r   )r   r   r   r	   r
   r   r   r   r   r   r   3   s   	
zLokyInitMainProcess.__init__)r   r    r!   r"   r   r$   r   r   r   r   r%   0   s    r%   c                   @   s   e Zd Zdd ZdS )AuthenticationKeyc                 C   s2   zt |  W n ty   tdw tt| ffS )NzGPickling an AuthenticationKey object is disallowed for security reasons)r   RuntimeError	TypeErrorr'   bytes)r   r   r   r   
__reduce__M   s   zAuthenticationKey.__reduce__N)r   r    r!   r+   r   r   r   r   r'   L   s    r'   )	r   multiprocessing.contextr   multiprocessing.processr   r   r%   r*   r'   r   r   r   r   <module>   s   #