]"@sddlZddlZddlZddlZddlZddlmZmZddlmZddlm Z dddd d d d gZ ej d krdZ dZ n9ej d koeeddZ ejjjdZ e rejjejdan ejaddZdd ZddZddZdd ZddddZddZddZdd ZgZddZ d d!Z!d"d#Z"d$d Z#dS)%N)get_start_methodset_start_method)process)util_mainfreeze_supportset_executableget_executableget_preparation_dataget_command_lineimport_main_pathwin32Ffrozenzpythonservice.exez python.execCs |adS)N) _python_exe)Zexer*/opt/alt/python35/lib64/python3.5/spawn.pyr )scCstS)N)rrrrrr -scCs.t|dkr&|ddkr&dSdSdS)Nrz--multiprocessing-forkTF)len)argvrrr is_forking4s"rcCsttjri}xYtjddD]D}|jd\}}|dkr]d||s   cKsttddr6tjdgdd|jDSd}|djdd |jD;}tj}tg|d |dgSdS) NrFz--multiprocessing-forkcSsg|]}d|qS)z%s=%rr).0itemrrr Ts z$get_command_line..zWsz#get_command_line..z-c)getattrr executableitemsjoinr_args_from_interpreter_flagsr)rprogZoptsrrrr Ns & c CstjdkrRddl}ddlm}|||}|j|tj}n"ddlm }||j _ |}t |}tj |dS)Nrrr) steal_handle)semaphore_tracker)rplatformmsvcrt reductionr,open_osfhandleosO_RDONLYr-Z_semaphore_trackerZ_fdrr) Z pipe_handleZ parent_pidZ tracker_fdr/r,Z new_handlefdr-exitcoderrrr\s   rcCswtj|dddR}dtj_z,tj|}t|tj|}Wdtj`XWdQRX|jS)NrbclosefdT) r2fdopenrcurrent_process _inheritingpickleloadprepare _bootstrap)r5Z from_parentZpreparation_dataselfrrrrns cCs(ttjddr$tddS)Nr;Fa 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&rr: RuntimeErrorrrrr_check_not_importing_mainzs rBcCsttdtjdtjj}tjdk rJtjj|d            cCsDd|kr|dtj_d|kr>|dtj_d|kr^|dr^tjd|krtjj|dd|kr|dt_ d|kr|dt_ d|krt j |dd|kr|dt_ d |kr t|d d d d |kr&t|d nd |kr@t|d dS)Nr rDrCrErFrGrIrHrJforceTrLrN)rr:r rDrrC get_loggersetLevelrrSrr2chdirrWr_fixup_main_from_name_fixup_main_from_path)datarrrr>s,              r>cCstjd}|dks(|jdr,dSt|jdd|krKdStj|tjd}t j |dddd}|j j ||tjdrhrir rrrr s>       !       2 &