Your IP : 3.144.104.175


Current Path : /opt/alt/python34/lib64/python3.4/multiprocessing/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib64/python3.4/multiprocessing/__pycache__/spawn.cpython-34.pyc

�
e f�"�@s�ddlZddlZddlZddlZddlZddlmZmZddlmZddlm	Z	dddd	d
ddgZ
ejd
kr�dZdZ
n9ejd
ko�eedd�Zejj�jd�Z
e
rejjejd�an	ejadd�Zdd	�Zdd�Zdd�Zdd�Zdddd�Zdd�Zdd�Zdd
�ZgZdd�Z d d!�Z!d"d#�Z"d$d�Z#dS)%�N�)�get_start_method�set_start_method)�process)�util�_main�freeze_support�set_executable�get_executable�get_preparation_data�get_command_line�import_main_path�win32F�frozenzpythonservice.exez
python.execCs
|adS)N)�_python_exe)Zexe�r�:/opt/alt/python34/lib64/python3.4/multiprocessing/spawn.pyr	)scCstS)N)rrrrrr
-scCs.t|�dkr&|ddkr&dSdSdS)z=
    Return whether commandline indicates we are forking
    �rz--multiprocessing-forkTFN)�len)�argvrrr�
is_forking4s"rcCs�ttj�r�i}xYtjdd�D]D}|jd�\}}|dkr]d||<q)t|�||<q)Wt|�tj�ndS)zE
    Run code for process object if this in not the main process
    rN�=�None)r�sysr�split�int�
spawn_main�exit)�kwds�arg�name�valuerrrr>s

cKs�ttdd�r6tjdgdd�|j�D�Sd}|djdd	�|j�D��;}tj�}tg|d
|dgSdS)zJ
    Returns prefix of command line used for spawning a child process
    rFz--multiprocessing-forkcSsg|]}d|�qS)z%s=%rr)�.0�itemrrr�
<listcomp>Ts	z$get_command_line.<locals>.<listcomp>z<from multiprocessing.spawn import spawn_main; spawn_main(%s)z, css|]}d|VqdS)z%s=%rNr)r"r#rrr�	<genexpr>Wsz#get_command_line.<locals>.<genexpr>z-cN)�getattrr�
executable�items�joinrZ_args_from_interpreter_flagsr)r�progZoptsrrrrNs&c	Cs�ttj�st�tjdkrgddl}ddlm}|||�}|j|t	j
�}n"ddlm}||j
_|}t|�}tj|�dS)z6
    Run code specifed by data received over pipe
    rrNr)�steal_handle)�semaphore_tracker)rrr�AssertionError�platform�msvcrtZ	reductionr+Zopen_osfhandle�os�O_RDONLY�r,Z_semaphore_trackerZ_fdrr)	Zpipe_handleZ
parent_pidZ
tracker_fdr/r+Z
new_handle�fdr,Zexitcoderrrr\srcCsvtj|ddd��R}dtj�_z,tj|�}t|�tj|�}Wdtj�`XWdQX|j�S)N�rb�closefdT)	r0�fdopenr�current_process�_inheriting�pickle�load�prepare�
_bootstrap)r3Zfrom_parentZpreparation_data�selfrrrrns
cCs+ttj�dd�r'td��ndS)Nr8Fa
        An attempt has been made to start a new process before the
        current process has finished its bootstrapping phase.

        This probably means that you are not using fork to start your
        child processes and you have forgotten to use the proper idiom
        in the main module:

            if __name__ == '__main__':
                freeze_support()
                ...

        The "freeze_support()" line can be omitted if the program
        is not going to be frozen to produce an executable.)r&rr7�RuntimeErrorrrrr�_check_not_importing_mainzs
r?cCs�t�tdtjdtj�j�}tjdk	rMtjj�|d<nt	j
j�}y|jd�}Wnt
k
r�YnXtj||<|jd|d|dt	jd	tjd
tj�dt��t	jd}t|jdd�}|dk	r	||d
<n�t	jdks&tr�tr�t|dd�}|dk	r�tj
j|�r�tjdk	r�tj
jtj|�}ntj
j|�|d<q�n|S)zM
    Return info about parent needed by child to unpickle process object
    �
log_to_stderr�authkeyN�	log_levelr2r �sys_path�sys_argv�orig_dir�dir�start_method�__main__�init_main_from_namer�__file__�init_main_from_path)r?�dictrZ_log_to_stderrrr7rAZ_loggerZgetEffectiveLevelr�path�copy�index�
ValueError�ORIGINAL_DIR�updaterr0�getcwdr�modulesr&�__spec__r.�WINEXE�
WINSERVICE�isabsr)�normpath)r �drC�i�main_moduleZ
main_mod_name�	main_pathrrrr�s>	

			


cCs\d|kr"|dtj�_nd|krD|dtj�_nd|krg|drgtj�nd|kr�tj�j|d�nd|kr�|dt_	nd|kr�|dt_
nd|kr�tj|d�nd|kr|dt_
nd	|krt|d	�nd
|kr;t|d
�nd|krXt|d�ndS)
zE
    Try to get current process ready to unpickle process object
    r rAr@rBrCrDrFrErGrIrKN)rr7r rArr@Z
get_loggerZsetLevelrrMrr0�chdirrQr�_fixup_main_from_name�_fixup_main_from_path)�datarrrr;�s,
r;cCs�tjd}|dks(|jd�r,dSt|jdd�|krKdStj|�tjd�}t	j
|dddd�}|jj|�|tjd<tjd<dS)NrHz	.__main__r �__mp_main__�run_nameZ	alter_sysT)
rrT�endswithr&rU�old_main_modules�append�types�
ModuleType�runpyZ
run_module�__dict__rR)Zmod_name�current_mainr\�main_contentrrrr_�s

	r_cCs�tjd}tjjtjj|��d}|dkr?dSt|dd�|kr[dStj|�t	j
d�}tj|dd�}|j
j|�|tjd<tjd<dS)NrHrZipythonrJrbrc)rrTr0rM�splitext�basenamer&rerfrgrhriZrun_pathrjrR)r]rkZ	main_namer\rlrrrr`�s
"
	r`cCst|�dS)z<
    Set sys.modules['__main__'] to module at main_path
    N)r`)r]rrrr
s)$r0r9rrirgr2rrrr�__all__r.rVrWr&r'�lowerrdrMr)�exec_prefixrr	r
rrrrrr?rrer;r_r`r
rrrr�<module>s>	!	
2&

?>