U n^@sddlZddlZddlZddlZddlZddlmZejdrJddZ nej Z ej rhddZ e ZdZnddZ ejZejZd d Zd d Zd dZejdddkrddlZddlZddlZddlZGdddejjZn ddlmZdS)N)sixwinc CsPzt|Wn0tk r>}z|jtjks.W5d}~XYnXt||dSN)osremoveOSErrorerrnoENOENTrename)Zcurrent_filenameZ new_filenameer m/private/var/folders/sd/whlwsn6x1_qgglc0mjv25_695qk2gl/T/pip-install-4zq3fp6i/s3transfer/s3transfer/compat.py rename_files  rcCst|dSN)inspectgetfullargspecfuncr r r accepts_kwargs&srcCst|dSr)r getargspecrr r r r2sc CsXt|dr|St|drTt|drTz|ddWdSttfk rRYdSXdS)zBackwards compat function to determine if a fileobj is seekable :param fileobj: The file-like object to determine if seekable :returns: True, if seekable. False, otherwise. seekableseektellrTF)hasattrrrrIOErrorfileobjr r r r9s  rcCst|dr|St|dS)zDetermines whether or not a file-like object is readable. :param fileobj: The file-like object to determine if readable :returns: True, if readable. False otherwise. readableread)rrrr r r rQs rcCs,ttdrt|d|n ||dS)Nposix_fallocater)rrr!filenotruncate)rsizer r r fallocate^s r%r)rc@s$eZdZdddZedddZdS) BaseManagerNr c Cs|jjtjjjkst|dk r0t|ds0tdtj dd\}}tj t |j |j |j|j|j|||fd|_ddd |jjD}t |jd ||j_|j|||_|tjjj|j_tjj|t |j|j|j|j|j|jfd d |_dS) zH Spawn a server process for this manager object N__call__zinitializer must be a callableF)Zduplex)targetargs:css|]}t|VqdSr)str).0ir r r sz$BaseManager.start..-r)r*Z exitpriority)_statevaluemultiprocessingmanagersStateZINITIALAssertionErrorr TypeErrorZPipeProcesstype _run_server _registryZ_addressZ_authkeyZ _serializerZ_processjoinZ _identity__name__namestartcloserecvZSTARTEDutilZFinalizeZ_finalize_managerZ_Clientshutdown)self initializerinitargsreaderwriteridentr r r r?ps>     zBaseManager.startc CsP|dk r|||||||}||j|tjd|j|dS)zH Create a server, report its address and run it Nzmanager serving at %r)Z_Serversendaddressr@r3rBinfo serve_forever) clsregistryrKZauthkey serializerrHrErFserverr r r r:s zBaseManager._run_server)Nr )Nr )r= __module__ __qualname__r? classmethodr:r r r r r'os  %r')r')rsysrrsocketZbotocore.compatrplatform startswithrr PY3rConnectionErrorZ SOCKET_ERRORMAXINTerrorZmaxintrrr% version_infor3Zmultiprocessing.managersZmultiprocessing.connectionZmultiprocessing.utilr4r'r r r r  s2     >