o gc(%@sddlmZddlZddlZddlZddlZddlZddlZddlZddl m Z gdZ ej dkp@e edo@e edo@e ejd ZGd d d ejZejZd8d d Zej dkr~e gd7Z ddlZd9ddddZddZddZddZGdddeZn#e gd7Z ddlZej dkZddZdd Zd!dZd"dZd#d$Zd%d&ZGd'd(d(Z ee!e j"ed)d*Z#ee!e$j%e#ee!e&j'e#d+d,Z(d-d.Z)eej*e(ej dkrd/d0Z+d1d2Z,eeje+nd3d0Z+d4d2Z,eeje+Gd5d6d6ed7Z-dS):)ABCMetaN)context) send_handle recv_handleForkingPicklerregisterdumpwin32ZCMSG_LEN SCM_RIGHTSsendmsgcsHeZdZ iZejZfddZeddZ edddZ e j Z Z S) rcs*tj||j|_|j|jdSN)super__init___copyreg_dispatch_tablecopydispatch_tableupdate_extra_reducersselfargs __class__z/home/lily/lilypond-2.24.1/release/binaries/dependencies/install/Python-3.10.8/lib/python3.10/multiprocessing/reduction.pyr&s  zForkingPickler.__init__cCs ||j|<dSr )r)clstypereducerrrr+szForkingPickler.registerNcCs t}|||||Sr )ioBytesIOr getbuffer)robjprotocolbufrrrdumps0szForkingPickler.dumpsr )__name__ __module__ __qualname__rcopyregrrr classmethodrr%pickleloads __classcell__rrrrr!s   rcCs t|||dSr )rr )r"filer#rrrr :sr ) DupHandle duplicate steal_handleF)source_processcCs8 t}|dur |}|dur|}t|||d|tjS)Nr)_winapiGetCurrentProcessDuplicateHandleDUPLICATE_SAME_ACCESS)handleZtarget_processZ inheritabler2current_processrrrr0Gsr0c CsL ttjd|}zt||tddtjtjBWt|St|wNFr)r3 OpenProcessPROCESS_DUP_HANDLEr5r4r6DUPLICATE_CLOSE_SOURCE CloseHandle)Z source_pidr7Zsource_process_handlerrrr1Ss  r1cCs t|tj|}||dSr )r/r3r6send)connr7destination_pidZdhrrrr_srcCs |Sr )recvdetach)r?rrrrds rc@s eZdZ dddZddZdS)r/Nc Csf|durt}ttjd|}ztt|||dd|_Wt|nt|w||_ ||_ dSr9) osgetpidr3r:r;r5r4_handler=_access_pid)rr7accesspidprocrrrrjs  zDupHandle.__init__c Cs` |jtkr |jSttjd|j}zt||jt|j dtj Wt |St |wNF) rGrCrDrEr3r:r;r5r4rFr<r=)rrJrrrrBys   zDupHandle.detachr )r&r'r(rrBrrrrr/hs  r/)DupFdsendfdsrecvfdsdarwincCs\ td|}tt|dg}||gtjtj|fgtr*|ddkr,t ddSdS)NirAz%did not receive acknowledgement of fd) arraybyteslenr socket SOL_SOCKETr ACKNOWLEDGErA RuntimeError)sockZfdsmsgrrrrMs rMc Cs td}|j|}|dt|\}}}}|s|stz[tr&|dt|dkr4t dt||d\}} } |tj krp| tj krut| |jdkrPt | | t|d|dkrktdt||dt|WSWt dWt dt tfyYt dw) NrPrrRzreceived %d items of ancdatarrQz Len is {0:n} but msg[0] is {1!r}zInvalid data received)rSitemsizeZrecvmsgrVZ CMSG_SPACEEOFErrorrXr>rUrYrWr ValueErrorZ frombytesAssertionErrorformatlist IndexError) rZsizeaZ bytes_sizer[ZancdataflagsZaddrZ cmsg_levelZ cmsg_typeZ cmsg_datarrrrNsD           rNcCsJ t|tjtj}t||gWddS1swYdSr )rVfromfdfilenoAF_UNIX SOCK_STREAMrM)r?r7r@srrrrs"cCsJ t|tjtj}t|ddWdS1swYdS)Nrr)rVrfrgrhrirN)r?rjrrrrs $cCsD t}|dur|||Strddlm}||Std)Nr)resource_sharerz&SCM_RIGHTS appears not to be available)rget_spawning_popenrLZduplicate_for_childHAVE_SEND_HANDLErkr^)fdZ popen_objrkrrrrLs  rLcCs.|jdurt|j|jjffSt|j|jjffSr )__self__getattrr__func__r&mrrr_reduce_methods ruc@seZdZddZdS)_CcCsdSr r)rrrrfsz_C.fN)r&r'r(rwrrrrrvs rvcCst|j|jffSr )rq __objclass__r&rsrrr_reduce_method_descriptorsrycCst|j|j|jp iffSr )_rebuild_partialfuncrkeywords)prrr_reduce_partialr~cCstj|g|Ri|Sr ) functoolspartial)r{rr|rrrrzrrzcCsddlm}t||ffS)Nr) DupSocket)rkr_rebuild_socket)rjrrrr_reduce_sockets rcCs|Sr )rB)ZdsrrrrsrcCs"t|}t||j|j|jffSr )rLrgrfamilyrproto)rjdfrrrrs cCs|}tj||||dS)N)rg)rBrV)rrrrrorrrrsc@sbeZdZ eZeZeZeZeZej dkre Z e Z e Z ne Z eZeZeZeZeZeZeZddZdS)AbstractReducerr cGsNtttjttttjttttj ttt j t tt j tdSr )rrrvrwruraappendryint__add__rrr~rVrrrrrrs  zAbstractReducer.__init__N)r&r'r(rrr rrsysplatformr1r0r/rMrNrLruryrzrrrrrrrrs(  r) metaclassr rK).abcrr)rrrCr+rVrrnr__all__rhasattrrmZPicklerrrr r3r0r1rrobjectr/rSrXrMrNrLrurvrrwryrarrrr~rzrrrrrrrrsl             #