f%ddlZddlZddlZddlZddlmZmZddlmZddlm Z ddlm Z gdZ ej dkrd Z d Zn@eed d Z ejo+ejd Zd Zd Zer*eejejdneejdZdZdZddZdZdZdZgZdZ dZ!dZ"dZ#dS)N)get_start_methodset_start_method)process) reduction)util)_mainfreeze_supportset_executableget_executableget_preparation_dataget_command_lineimport_main_pathwin32Ffrozenzpythonservice.exec||adStjdkrtj|adStj|adS)Nr) _python_exesysplatformosfsdecodefsencode)exes z$get_command_line..Ys999D4999rzz#get_command_line..\s&BBT'D.BBBBBBrz-c)getattrr executableitemsjoinr_args_from_interpreter_flagsr )r,progoptsrs rrrSssHe$$E!9:99DJJLL999: ;N  BBTZZ\\BBBBBB022ut|tT+CDDDrc tjdkrjddl}ddl}|%||j|jzd|}nd}tj||}| |tj }|}n(ddl m } || j_|}tj|}t#||} tj| dS)NrrF)source_processr)resource_tracker)rrmsvcrt_winapi OpenProcess SYNCHRONIZEPROCESS_DUP_HANDLEr duplicateopen_osfhandlerO_RDONLYrB_resource_tracker_fddupr r+) pipe_handle parent_pid tracker_fdrCrDrA new_handlefdparent_sentinelrBexitcodes rr*r*bs |w   !$00#g&@@z##NN"N(8FHHH  " ":r{ ; ;(&&&&&&1;*. &--R))HHXrctj|dd5}dtj_ t j|}t|t j|}tj`n#tj`wxYw dddn #1swxYwY| |S)NrbT)closefd) rfdopenrcurrent_process _inheritingrpickleloadprepare _bootstrap)rSrT from_parentpreparation_dataselfs rr r ~s 2tT * * *6k04!!- 6(/44[AA  $ % % %#((55D'))55'))5 5 5 5 55666666666666666 ??? + ++s)B8A B?B8B((B88B<?B<chttjddrtddS)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. To fix this issue, refer to the "Safe importing of main module" section in https://docs.python.org/3/library/multiprocessing.html )r9rrZ RuntimeErrorrrr_check_not_importing_mainres@w&((-??       rc  tttjt jj}tj!tj|d<tj } | d}tj ||<n#t$rYnwxYw|||tjtj t#jt'tjd}t+|jdd}|||d<ntjdkst0st2st+|d d}|wt"j |s6tj *t"j tj |}t"j ||d <|S) N) log_to_stderrauthkey log_levelrK)r.sys_pathsys_argvorig_dirdir start_method__main__r.init_main_from_namer__file__init_main_from_path)redictr_log_to_stderrrrZrh_loggergetEffectiveLevelrpathcopyindex ORIGINAL_DIR ValueErrorupdater#rgetcwdrmodulesr9__spec__rWINEXE WINSERVICEisabsr<normpath)r.drji main_module main_mod_name main_paths rr r s )'))1   A  |7799+ X]]__H+ NN2  *       HH % IKK%''     +j)KK0&$??M #0     KT::  GMM),, J,8GLL)=yII ')w'7'7 'B'BA# $ Hs B22 B?>B?c d|vr|dtj_d|vr|dtj_d|vr|drt jd|vr,t j|dd|vr|dt_ d|vr|dt_ d|vrtj |dd|vr|dt_ d |vrt|d d d |vrt|d dSd |vrt!|d dSdS)Nr.rhrgrirjrkrmrlrnT)forcerprr)rrZr.rhrrg get_loggersetLevelrrwr#rchdirrzr_fixup_main_from_name_fixup_main_from_path)datas rr^r^so~~)-f!!&D,0O!!)$4#8 d ""4 #4555T #T # }} eT#J/n-T::::$$d#89::::: $ & &d#89::::: ' &rctjd}|dks|drdSt|jdd|krdSt |tjd}tj |dd}|j ||xtjd<tjd<dS)Nroz .__main__r. __mp_main__T)run_name alter_sys) rr~endswithr9rold_main_modulesappendtypes ModuleTyperunpy run_module__dict__r|)mod_name current_mainr main_contents rrrs ;z*L:!2!2;!?!?|$fd33x?? L)))"=11K#H-:.2444L ---;FFCK ck-888rctjd}tjtj|d}|dkrdSt |dd|krdSt|tj d}tj |d}|j ||xtjd<tjd<dS)Nroripythonrqr)r)rr~rrwsplitextbasenamer9rrrrrrun_pathrr|)rr main_namerrs rrrs;z*L   !1!1)!)+8:::L ---;FFCK ck-888rc& t|dSr)r)rs rrr/s)$$$$$r)NN)$rrrrrKrrrcontextrr__all__rrrr9r:lowerrr r rwr< exec_prefixr$r rr*r rer rr^rrrrrrrs  00000000 K K K<7 FJJ WS(E * *FXCN$8$8$:$:$C$CDW$X$XJ'''#N27<<>>????N3>"""     E E E8 , , ,   ,, , , d";";";LGGG2GGG8%%%%%r