/snap/core18/2979/usr/lib/python3.6/__pycache__
NameSizeModeActions
abc.cpython-36.pyc75150644editdlrm
aifc.cpython-36.pyc259430644editdlrm
antigravity.cpython-36.pyc7790644editdlrm
argparse.cpython-36.pyc604560644editdlrm
ast.cpython-36.pyc117040644editdlrm
asynchat.cpython-36.pyc68150644editdlrm
asyncore.cpython-36.pyc158380644editdlrm
base64.cpython-36.pyc170590644editdlrm
bdb.cpython-36.pyc170330644editdlrm
binhex.cpython-36.pyc120860644editdlrm
bisect.cpython-36.pyc26760644editdlrm
bz2.cpython-36.pyc112820644editdlrm
calendar.cpython-36.pyc258820644editdlrm
cgi.cpython-36.pyc284160644editdlrm
cgitb.cpython-36.pyc100800644editdlrm
chunk.cpython-36.pyc49000644editdlrm
cmd.cpython-36.pyc125750644editdlrm
code.cpython-36.pyc98360644editdlrm
codecs.cpython-36.pyc339000644editdlrm
codeop.cpython-36.pyc62700644editdlrm
colorsys.cpython-36.pyc33110644editdlrm
compileall.cpython-36.pyc82780644editdlrm
configparser.cpython-36.pyc452440644editdlrm
contextlib.cpython-36.pyc111580644editdlrm
copy.cpython-36.pyc70790644editdlrm
copyreg.cpython-36.pyc42440644editdlrm
cProfile.cpython-36.pyc42940644editdlrm
crypt.cpython-36.pyc22420644editdlrm
csv.cpython-36.pyc118550644editdlrm
datetime.cpython-36.pyc545110644editdlrm
decimal.cpython-36.pyc3510644editdlrm
difflib.cpython-36.pyc596420644editdlrm
dis.cpython-36.pyc141810644editdlrm
doctest.cpython-36.pyc755890644editdlrm
dummy_threading.cpython-36.pyc11020644editdlrm
enum.cpython-36.pyc234530644editdlrm
filecmp.cpython-36.pyc83050644editdlrm
fileinput.cpython-36.pyc131520644editdlrm
fnmatch.cpython-36.pyc28740644editdlrm
formatter.cpython-36.pyc175790644editdlrm
fractions.cpython-36.pyc184260644editdlrm
ftplib.cpython-36.pyc283570644editdlrm
functools.cpython-36.pyc240620644editdlrm
genericpath.cpython-36.pyc37260644editdlrm
getopt.cpython-36.pyc62170644editdlrm
getpass.cpython-36.pyc41770644editdlrm
gettext.cpython-36.pyc143060644editdlrm
glob.cpython-36.pyc42590644editdlrm
gzip.cpython-36.pyc162260644editdlrm
hashlib.cpython-36.pyc66920644editdlrm
heapq.cpython-36.pyc142920644editdlrm
hmac.cpython-36.pyc48360644editdlrm
imaplib.cpython-36.pyc421380644editdlrm
imghdr.cpython-36.pyc41500644editdlrm
imp.cpython-36.pyc96960644editdlrm
inspect.cpython-36.pyc797390644editdlrm
io.cpython-36.pyc33870644editdlrm
ipaddress.cpython-36.pyc623860644editdlrm
keyword.cpython-36.pyc17650644editdlrm
linecache.cpython-36.pyc37780644editdlrm
locale.cpython-36.pyc340300644editdlrm
lzma.cpython-36.pyc119920644editdlrm
macpath.cpython-36.pyc56410644editdlrm
macurl2path.cpython-36.pyc18670644editdlrm
mailbox.cpython-36.pyc637520644editdlrm
mailcap.cpython-36.pyc72090644editdlrm
mimetypes.cpython-36.pyc155530644editdlrm
modulefinder.cpython-36.pyc153660644editdlrm
netrc.cpython-36.pyc38360644editdlrm
nntplib.cpython-36.pyc337800644editdlrm
ntpath.cpython-36.pyc131900644editdlrm
nturl2path.cpython-36.pyc14990644editdlrm
numbers.cpython-36.pyc121420644editdlrm
opcode.cpython-36.pyc54130644editdlrm
operator.cpython-36.pyc139130644editdlrm
optparse.cpython-36.pyc480540644editdlrm
os.cpython-36.pyc296280644editdlrm
pathlib.cpython-36.pyc420070644editdlrm
pdb.cpython-36.pyc460940644editdlrm
pickle.cpython-36.pyc426910644editdlrm
pickletools.cpython-36.pyc660200644editdlrm
pipes.cpython-36.pyc78080644editdlrm
pkgutil.cpython-36.pyc162610644editdlrm
platform.cpython-36.pyc291970644editdlrm
plistlib.cpython-36.pyc280550644editdlrm
poplib.cpython-36.pyc133290644editdlrm
posixpath.cpython-36.pyc104560644editdlrm
pprint.cpython-36.pyc158240644editdlrm
profile.cpython-36.pyc139010644editdlrm
pstats.cpython-36.pyc218570644editdlrm
pty.cpython-36.pyc38610644editdlrm
pyclbr.cpython-36.pyc83650644editdlrm
pydoc.cpython-36.pyc837750644editdlrm
py_compile.cpython-36.pyc65440644editdlrm
queue.cpython-36.pyc87550644editdlrm
quopri.cpython-36.pyc57730644editdlrm
random.cpython-36.pyc193300644editdlrm
re.cpython-36.pyc140580644editdlrm
reprlib.cpython-36.pyc54000644editdlrm
rlcompleter.cpython-36.pyc57800644editdlrm
runpy.cpython-36.pyc79820644editdlrm
sched.cpython-36.pyc65640644editdlrm
secrets.cpython-36.pyc21620644editdlrm
selectors.cpython-36.pyc176970644editdlrm
shelve.cpython-36.pyc94580644editdlrm
shlex.cpython-36.pyc69700644editdlrm
shutil.cpython-36.pyc307040644editdlrm
signal.cpython-36.pyc25150644editdlrm
site.cpython-36.pyc165600644editdlrm
sitecustomize.cpython-36.pyc2120644editdlrm
smtpd.cpython-36.pyc266830644editdlrm
smtplib.cpython-36.pyc353400644editdlrm
sndhdr.cpython-36.pyc69130644editdlrm
socket.cpython-36.pyc220130644editdlrm
socketserver.cpython-36.pyc242500644editdlrm
sre_compile.cpython-36.pyc102780644editdlrm
sre_constants.cpython-36.pyc59720644editdlrm
sre_parse.cpython-36.pyc203580644editdlrm
ssl.cpython-36.pyc369390644editdlrm
stat.cpython-36.pyc38510644editdlrm
statistics.cpython-36.pyc181740644editdlrm
string.cpython-36.pyc79640644editdlrm
stringprep.cpython-36.pyc100300644editdlrm
struct.cpython-36.pyc3120644editdlrm
subprocess.cpython-36.pyc354850644editdlrm
sunau.cpython-36.pyc169380644editdlrm
symbol.cpython-36.pyc25170644editdlrm
symtable.cpython-36.pyc104280644editdlrm
sysconfig.cpython-36.pyc159160644editdlrm
tabnanny.cpython-36.pyc69750644editdlrm
tarfile.cpython-36.pyc630850644editdlrm
telnetlib.cpython-36.pyc180970644editdlrm
tempfile.cpython-36.pyc253090644editdlrm
textwrap.cpython-36.pyc136840644editdlrm
this.cpython-36.pyc12650644editdlrm
threading.cpython-36.pyc372340644editdlrm
timeit.cpython-36.pyc116030644editdlrm
token.cpython-36.pyc33200644editdlrm
tokenize.cpython-36.pyc186470644editdlrm
trace.cpython-36.pyc194950644editdlrm
traceback.cpython-36.pyc196460644editdlrm
tracemalloc.cpython-36.pyc172290644editdlrm
tty.cpython-36.pyc10720644editdlrm
turtle.cpython-36.pyc1317510644editdlrm
types.cpython-36.pyc82010644editdlrm
typing.cpython-36.pyc733060644editdlrm
uu.cpython-36.pyc34980644editdlrm
uuid.cpython-36.pyc209180644editdlrm
warnings.cpython-36.pyc132580644editdlrm
wave.cpython-36.pyc178850644editdlrm
weakref.cpython-36.pyc191430644editdlrm
webbrowser.cpython-36.pyc157970644editdlrm
xdrlib.cpython-36.pyc83020644editdlrm
zipapp.cpython-36.pyc55340644editdlrm
zipfile.cpython-36.pyc497280644editdlrm
_bootlocale.cpython-36.pyc9800644editdlrm
_collections_abc.cpython-36.pyc287970644editdlrm
_compat_pickle.cpython-36.pyc65660644editdlrm
_compression.cpython-36.pyc41040644editdlrm
_dummy_thread.cpython-36.pyc48510644editdlrm
_markupbase.cpython-36.pyc79910644editdlrm
_osx_support.cpython-36.pyc96840644editdlrm
_pydecimal.cpython-36.pyc1634020644editdlrm
_pyio.cpython-36.pyc713860644editdlrm
_sitebuiltins.cpython-36.pyc34350644editdlrm
_strptime.cpython-36.pyc159630644editdlrm
_sysconfigdata_m_linux_x86_64-linux-gnu.cpython-36.pyc187790644editdlrm
_threading_local.cpython-36.pyc64250644editdlrm
_weakrefset.cpython-36.pyc78280644editdlrm
__future__.cpython-36.pyc41670644editdlrm
__phello__.foo.cpython-36.pyc1190644editdlrm
Edit: /snap/core18/2979/usr/lib/python3.6/__pycache__/subprocess.cpython-36.pyc (35485B)
3 Nqi@s8dZddlZejdkZddlZddlZddlZddlZddlZddl Z ddl Z ddlm Z Gddde ZGdddeZGd d d eZerddlZddlZddlZGd d d ZnhddlZddlZddlZy ddlZWnek rddlZYnXeed dZeedrejZnejZddddddddddddd dgZ erddlm!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(e j)ddddd d!d"d#d g Gd$d%d%e*Z+gZ,d&d'Z-dZ0d+d,Z1d-d.Z2dd/d0dZ3d1dZ4dd/d2dZ5Gd3dde6Z7ddd4d5d6dZ8d7d8Z9d9dZ:d:dZ;e6Z}|jtjd}|dk rytj|Wqtk rJYqXqWdS)N) _deadstate)_active_internal_pollsysmaxsizeremover)ZinstZresrrr_cleanupsrDcCs*g}tjj}|dkr&|jdd||S)zgReturn a list of command-line arguments reproducing the current optimization settings in sys.flags.r-O)rAflagsoptimizeappend)argsrrrr"_optim_args_from_interpreter_flagss rNcCsddddddd}t}x:|jD].\}}ttj|}|dkr"|jd ||q"Wtjjrh|jd n$tjjrz|jd tjjr|jd xtj D]}|jd |qWttdi}xDdD]<}||kr||}|dkr|}n d||f}|j d|fqW|S)z}Return a list of command-line arguments reproducing the current settings in sys.flags, sys.warnoptions and sys._xoptions.dBSvbq)debugdont_write_bytecodeno_siteverbose bytes_warningquietrrHz-Iz-Ez-sz-W _xoptions faulthandler tracemallocshowalloccount showrefcountutf8Tz%s=%sz-X)r\r]r^r_r`) rNitemsgetattrrArJrLisolatedignore_environment no_user_site warnoptionsextend)Z flag_opt_maprMflagZoptrRZxoptionsrargrrr_args_from_interpreter_flagss:       rj)rcOsFt||2}y |j|dS|j|jYnXWdQRXdS)zRun command with arguments. Wait for command to complete or timeout, then return the returncode attribute. The arguments are the same as for the Popen constructor. Example: retcode = call(["ls", "-l"]) )rN)r!waitkill)r popenargskwargsprrrr$s  cOs6t||}|r2|jd}|dkr(|d}t||dS)aORun command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute. The arguments are the same as for the call function. Example: check_call(["ls", "-l"]) rMNr)r$getr )rmrnretcoder rrrr%(s   cOsTd|krtdd|kr<|ddkr<|jddr4dnd|d<t|t|d d |jS) a(Run command with arguments and return its output. If the exit code was non-zero it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute and output in the output attribute. The arguments are the same as for the Popen constructor. Example: >>> check_output(["ls", "-l", "/dev/null"]) b'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n' The stdout argument is not allowed as it is used internally. To capture standard error in the result, use stderr=STDOUT. >>> check_output(["/bin/sh", "-c", ... "ls -l non_existent_file ; exit 0"], ... stderr=STDOUT) b'ls: non_existent_file: No such file or directory\n' There is an additional optional argument, "input", allowing you to pass a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it too will be used internally. Example: >>> check_output(["sed", "-e", "s/foo/bar/"], ... input=b"when in the course of fooman events\n") b'when in the course of barman events\n' If universal_newlines=True is passed, the "input" argument must be a string and the return value will be a string rather than bytes. rz3stdout argument not allowed, it will be overridden.inputNuniversal_newlinesFT)rrcheck)rrpr)r"r)rrmrnrrrr(;s c@s*eZdZdZd ddZddZddZdS) r+aEA process that has finished running. This is returned by run(). Attributes: args: The list or str args passed to run(). returncode: The exit code of the process, negative for signals. stdout: The standard output (None if not captured). stderr: The standard error (None if not captured). NcCs||_||_||_||_dS)N)rMr rr )rrMr rr rrrrrszCompletedProcess.__init__cCshdj|jdj|jg}|jdk r4|jdj|j|jdk rP|jdj|jdjt|jdj|S)Nz args={!r}zreturncode={!r}z stdout={!r}z stderr={!r}z{}({})z, ) formatrMr rrLr typerjoin)rrMrrrr;xs   zCompletedProcess.__repr__cCs |jrt|j|j|j|jdS)z6Raise CalledProcessError if the exit code is non-zero.N)r r rMrr )rrrrcheck_returncodesz!CompletedProcess.check_returncode)NN)rrrrrr;rzrrrrr+gs   F)rrrrvc Os|dk r d|krtdt|d<t||}y|j||d\}}WnVtk r||j|j\}}t|j|||dYn|j|jYnX|j}|r|rt ||j||dWdQRXt |j|||S)afRun command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, and output & stderr attributes if those streams were captured. If timeout is given, and the process takes too long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it will be used internally. The other arguments are the same as for the Popen constructor. If universal_newlines=True is passed, the "input" argument must be a string and stdout/stderr in the returned object will be strings rather than bytes. Nstdinz/stdin and input arguments may not both be used.)r)r r ) rr"r! communicaterrlrMrkpollr r+) rrrrvrmrnZprocessrr rqrrrr)s*    cCsg}d}x|D]}g}|r$|jdd|kp8d|kp8| }|rH|jdxj|D]b}|dkrf|j|qN|dkr|jdt|dg}|jdqN|r|j|g}|j|qNW|r|j||r|j||jdqWdj|S) a Translate a sequence of arguments into a command line string, using the same rules as the MS C runtime: 1) Arguments are delimited by white space, which is either a space or a tab. 2) A string surrounded by double quotation marks is interpreted as a single argument, regardless of white space contained within. A quoted string can be embedded in an argument. 3) A double quotation mark preceded by a backslash is interpreted as a literal double quotation mark. 4) Backslashes are interpreted literally, unless they immediately precede a double quotation mark. 5) If backslashes immediately precede a double quotation mark, every pair of backslashes is interpreted as a literal backslash. If the number of backslashes is odd, the last backslash escapes the next double quotation mark as described in rule 3. F  "\rFz\"rt)rLlenrgry)seqresultZ needquoteriZbs_bufcrrr list2cmdlines4         rcCslyt|ddtd}d}Wn.tk rF}z|j}|j}WYdd}~XnX|dddkrd|dd}||fS) aReturn (exitcode, output) of executing cmd in a shell. Execute the string 'cmd' in a shell with 'check_output' and return a 2-tuple (status, output). The locale encoding is used to decode the output and process newlines. A trailing newline is stripped from the output. The exit status for the command can be interpreted according to the rules for the function 'wait'. Example: >>> import subprocess >>> subprocess.getstatusoutput('ls /bin/ls') (0, '/bin/ls') >>> subprocess.getstatusoutput('cat /bin/junk') (1, 'cat: /bin/junk: No such file or directory') >>> subprocess.getstatusoutput('/bin/junk') (127, 'sh: /bin/junk: not found') >>> subprocess.getstatusoutput('/bin/kill $$') (-15, '') T)shellrsr rNrE r)r(r#r r r )r dataZexitcodeZexrrrr&s cCs t|dS)a%Return output (stdout or stderr) of executing cmd in a shell. Like getstatusoutput(), except the exit status is ignored and the return value is a string containing the command's output. Example: >>> import subprocess >>> subprocess.getoutput('ls /bin/ls') '/bin/ls' rE)r&)r rrrr'"s c@seZdZdZdZd?dddddeddddddddffddddd Zd d Zd d ZddZ e j e j fddZddZddZd@ddZddZddZddZerddZd d!Zd"d#Zdejejejfd$d%ZdAd&d'Zd(d)Zd*d+Z d,d-Z!d.d/Z"e"Z#nd0dZd1d#Ze$j%e$j&e$j'e$j(e$j)e$j*fd2d3Z+de$j,e$j-e.j/fd4d%Zd5d6Z0dBd7d'Zd8d+Z d9d:Z1d;d-Z!dZ#dS)Cr!a Execute a child program in a new process. For a complete description of the arguments see the Python documentation. Arguments: args: A string, or a sequence of program arguments. bufsize: supplied as the buffering argument to the open() function when creating the stdin/stdout/stderr pipe file objects executable: A replacement program to execute. stdin, stdout and stderr: These specify the executed programs' standard input, standard output and standard error file handles, respectively. preexec_fn: (POSIX only) An object to be called in the child process just before the child is executed. close_fds: Controls closing or inheriting of file descriptors. shell: If true, the command will be executed through the shell. cwd: Sets the current directory before the child is executed. env: Defines the environment variables for the new process. universal_newlines: If true, use universal line endings for file objects stdin, stdout and stderr. startupinfo and creationflags (Windows only) restore_signals (POSIX only) start_new_session (POSIX only) pass_fds (POSIX only) encoding and errors: Text mode encoding and error handling to use for file objects stdin, stdout and stderr. Attributes: stdin, stdout, stderr, pid, returncode FrENrT)encodingerrorscCsrttj|_d|_d|_|dkr(d}t|ts:tdt r|dk rNt d|dk pd|dk pd|dk }|t kr~|rxd}qd}q|r|rt dnF|t krd}|r| rt j dtd}| dk rt d |d krt d ||_d|_d|_d|_d|_d|_| |_||_||_|j|||\}}}}}}t rz|dkrFtj|jd }|dkr`tj|jd }|dkrztj|jd }|p|p| }d|_y|dkrtj|d ||_|rtj|jd|dk||d |_|dkrtj|d||_|rtj|j||d|_|dkr6tj|d||_|r6tj|j||d|_|j |||||| | | || ||||||||WnxDt!d|j|j|jfD]*}y |j"Wnt#k rYnXqW|jsfg}|t$kr|j%||t$kr|j%||t$kr|j%|t&|dr|j%|j'xP|D]H}y*t r)_child_createdr rResourceWarningr@r?rL)rZ_maxsizeZ_warnrrrr= s    z Popen.__del__cCs"t|dstjtjtj|_|jS)Nr)rrrdevnullO_RDWRr)rrrr _get_devnulls zPopen._get_devnullcCs|rZy|jj|WnDtk r(Yn2tk rX}z|jtjkrFnWYdd}~XnXy|jjWnDtk r|Yn2tk r}z|jtjkrnWYdd}~XnXdS)N)r{writeBrokenPipeErrorrerrnoZEINVALr)rrrexcrrr _stdin_writes"  zPopen._stdin_writec Cs|jr|rtd|dkr|j r|j|j|jgjddkrd}d}|jrV|j|n6|jrr|jj}|jjn|jr|jj}|jj|j nJ|dk rt |}nd}z|j |||\}}Wdd|_X|j |j |d}||fS)a4Interact with process: Send data to stdin. Read data from stdout and stderr, until end-of-file is reached. Wait for process to terminate. The optional "input" argument should be data to be sent to the child process (if self.universal_newlines is True, this should be a string; if it is False, "input" should be bytes), or None, if no data should be sent to the child. communicate() returns a tuple (stdout, stderr). These will be bytes or, if self.universal_newlines was True, a string. z.Cannot send input after starting communicationNrFT)r) rrr{rr countrreadrrk_time _communicate_remaining_time)rrrrrr endtimestsrrrr|7s.        zPopen.communicatecCs|jS)zSCheck if child process has terminated. Set and return returncode attribute.)r@)rrrrr}hsz Popen.pollcCs|dkr dS|tSdS)z5Convenience for _communicate when computing timeouts.N)r)rrrrrrnszPopen._remaining_timecCs&|dkr dSt|kr"t|j|dS)z2Convenience for checking if a timeout has expired.N)rrrM)rr orig_timeoutrrr_check_timeoutvs zPopen._check_timeoutc Cs|dkr|dkr|dkrd Sd \}}d\}}d\}} |dkrttjtj}|dkrrtjdd\}} t|}tj| nj|tkrtjdd\}}t|t|}}n>|tkrtj |j }n&t |t rtj |}ntj |j }|j|}|dkr,tjtj}|dkrtjdd\} }t|}tj| nn|tkrZtjdd\}}t|t|}}n@|tkrttj |j }n&t |t rtj |}ntj |j }|j|}|dkrtjtj} | dkrftjdd\} } t| } tj| n~|tkrtjdd\}} t|t| }} nP|tkr&|} n@|tkr@tj |j } n&t |t rXtj |} ntj |j } |j| } |||||| fS)z|Construct and return tuple with IO objects: p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite NrErrrrrrr)rrrrrrrr)rrrr)rrrr)rr)r<Z GetStdHandler.Z CreatePiper4r6r"r*rZ get_osfhandlerrr8fileno_make_inheritabler/r0r#) rr{rr rrrrrr_rrrrsn                        zPopen._get_handlescCs&tjtj|tjddtj}t|S)z2Return a duplicate of handle, which is inheritablerrE)r<ZDuplicateHandleZGetCurrentProcessZDUPLICATE_SAME_ACCESSr4)rZhandlehrrrrs  zPopen._make_inheritablecCsJ| stdt|ts t|}|dkr.t}d | ||fkr^|jtjO_| |_||_ ||_ | r|jtj O_tj |_ tjjdd}dj||}z>tj||ddt| | ||dk rtj|nd| \}}}}Wd| d kr| j|d kr|j|d kr|jt|drtj|jd|_Xd|_t||_||_tj|dS) z$Execute program (MS Windows version)z"pass_fds not supported on Windows.NrEZCOMSPECzcmd.exez {} /c "{}"rTrrrr)AssertionErrorrstrrrrr<r2rrrr3r1rrenvironrprwZ CreateProcessr8fspathr7rrrrrr4_handlerr6)rrMrrrrrrrrrrrrrrrZunused_restore_signalsZunused_start_new_sessionZcomspecZhpZhtrtidrrrrsH       zPopen._execute_childcCs,|jdkr&||jd|kr&||j|_|jS)zCheck if child process has terminated. Returns returncode attribute. This method is called by __del__, so it can only refer to objects in its local scope. Nr)r r)rr>Z_WaitForSingleObjectZ_WAIT_OBJECT_0Z_GetExitCodeProcessrrrr@s  zPopen._internal_pollcCs|dk r"tjdtdd|j|}|dkr2tj}n t|d}|jdkrztj|j |}|tj krlt |j |tj |j |_|jS)zOWait for child process to terminate. Returns returncode attribute.Nz0'endtime' argument is deprecated; use 'timeout'.rF) stackleveli)rrDeprecationWarningrr<ZINFINITEr8r WaitForSingleObjectrZ WAIT_TIMEOUTrrMGetExitCodeProcess)rrrZtimeout_millisrrrrrk$s      z Popen.waitcCs|j|j|jdS)N)rLrr)rZfhbufferrrr _readerthread:szPopen._readerthreadcCs`|jrDt|d rDg|_tj|j|j|jfd|_d|j_|jj|j rt|d rg|_ tj|j|j |j fd|_ d|j _|j j|j r|j ||jdk r|jj|j||jjrt|j||j dk r|j j|j||j jrt|j|d}d}|jr|j}|jj|j r4|j }|j j|dk rF|d}|dk rX|d}||fS)N _stdout_buff)targetrMT _stderr_buffr)rrrrZThreadrZ stdout_threadZdaemonstartr rZ stderr_threadr{rryrZis_aliverrMr)rrrrrrr rrrr?sF             zPopen._communicatecCsl|jdk rdS|tjkr"|jnF|tjkr>tj|jtjn*|tjkrZtj|jtjnt dj |dS)zSend a signal to the process.NzUnsupported signal: {}) r rSIGTERM terminateZ CTRL_C_EVENTrrlrZCTRL_BREAK_EVENTrrw)rsigrrr send_signalss     zPopen.send_signalc CsX|jdk rdSytj|jdWn2tk rRtj|j}|tjkrH||_YnXdS)zTerminates the process.NrE)r r<ZTerminateProcessrPermissionErrorrZ STILL_ACTIVE)rZrcrrrrs   zPopen.terminatec Cs.d\}}d\}}d \}} |dkr"n@|tkr8tj\}}n*|tkrJ|j}nt|trZ|}n|j}|dkrln@|tkrtj\}}n*|tkr|j}nt|tr|}n|j}|dkrnh|tkrtj\}} nR|tkr|d kr|} n t j j} n.|tkr|j} nt|tr|} n|j} |||||| fS) z|Construct and return tuple with IO objects: p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite rENrr)rrrr)rrrr)rrr) r"rpiper*rrr8rr#rA __stdout__) rr{rr rrrrrrrrrrsJ         c)"st|ttfr|g}nt|}| r:ddg|}r:|d<dkrJ|d}tj\}}g}x |dkr~|j|tj|}q`Wx|D]}tj|qWzz|dk rg}xL|j D]:\}}tj |}d|krt d|j|dtj |qWnd}tj tj j rf}ntfdd tj|D}t|}|j|tj|||tttt|||| | | |||||||||_d |_Wdtj|Xt|d d}| dkr| dkr| |krtj| |dkr| dkr||krtj||dkr|dkr||krtj||dk r.tj|d |_t}x2tj|d }||7}| sft|d krsz'Popen._execute_child..TrrEiP:rFsSubprocessError0z#Bad exception data from child: {!r}asciiZnoexecrtz: rrrrrr)/rrbyteslistrrrLduprrarrrdirnametuple get_exec_pathsetadd_posixsubprocessZ fork_execsortedmapr8rrrbr bytearrayrrwaitpid_handle_exitstatusrArBr ChildProcessErrorsplitrrwbuiltinsr issubclassrstrerrorrENOENTrepr))rrMrrrrrrrrrrrrrrrrrZorig_executableZ errpipe_readZ errpipe_writeZlow_fds_to_closeZlow_fdZenv_listkrRZexecutable_listZ fds_to_keepZ devnull_fdZ errpipe_datapartrrZexception_nameZ hex_errnoZerr_msgZchild_exception_typeZ errno_numZchild_exec_never_calledZ err_filenamer)rrrs                                cCsL||r|| |_n2||r*|||_n||r@|| |_ntddS)z:All callers to this function MUST hold self._waitpid_lock.zUnknown child exit status!N)r r)rrZ _WIFSIGNALEDZ _WTERMSIGZ _WIFEXITEDZ _WEXITSTATUSZ _WIFSTOPPEDZ _WSTOPSIGrrrr Xs zPopen._handle_exitstatuscCs|jdkr|jjdsdSzy8|jdk r.|jS||j|\}}||jkrR|j|WnBtk r}z&|dk rv||_n|j|krd|_WYdd}~XnXWd|jjX|jS)zCheck if child process has terminated. Returns returncode attribute. This method is called by __del__, so it cannot reference anything outside of the local scope (nor can any methods it calls). NFr)r racquirerr rrrelease)rr>Z_waitpidZ_WNOHANGZ_ECHILDrrerrrr@js      c Cs>ytj|j|\}}Wntk r4|j}d}YnX||fS)z:All callers to this function MUST hold self._waitpid_lock.r)rr rr )rZ wait_flagsrrrrr _try_waits  zPopen._try_waitc Csp|jdk r|jS|dk r(tjdtdd|dk s8|dk r^|dkrLt|}n|dkr^|j|}|dk rd}x|jjdrzL|jdk rP|jt j \}}||j ks|dkst ||j kr|j |PWd|jjX|j|}|dkrt|j|t|d|d}tj|qnWnXxV|jdkrh|j8|jdk r6P|jd\}}||j krZ|j |WdQRXqW|jS) zOWait for child process to terminate. Returns returncode attribute.Nz0'endtime' argument is deprecated; use 'timeout'.rF)rgMb@?Frg?)r rrrrrrrrrWNOHANGrrr rrrMmintimeZsleep)rrrZdelayrrZ remainingrrrrksL             c#Cs|jrZ|j rZy|jjWntk r0YnX|sZy|jjWntk rXYnXd}d}|jsi|_|jrg|j|j<|jrg|j|j<|jr|j|j}|jr|j|j}|j||j rt |j }t }|jr|r|j |jt j|jr |j |jt j|jr$|j |jt jxJ|jrp|j|}|dk r\|dkr\t|j||j|} |j||x| D]\} } | j|jkr||j|jt} y|jtj| j| 7_Wn,tk r|j| j| jjYn*X|jt|j krf|j| j| jjnP| j|j|jfkrxtj| jd} | sT|j| j| jj|j| jj| qxWq(WWdQRX|j |j|d|dk rdj!|}|dk rdj!|}|j"s|j#s|j$r|dk r|j%||jj"|jj#}|dk r|j%||jj"|jj#}||fS)Nri)rru)&r{rflushrrZ_fileobj2outputrr _save_inputr memoryview_PopenSelectorregister selectorsZ EVENT_WRITEZ EVENT_READZget_maprrrMselectrZfileobj _input_offset _PIPE_BUFrrrZ unregisterrrrLrkryrrrsr)rrrrrrr Z input_viewZselectorrZreadykeyZeventschunkrrrrrs                 (        cCsR|jrN|jdkrNd|_||_|dk rN|js6|js6|jrN|jj|jj|jj|_dS)Nr)r{rr"rrrsencode)rrrrrrr/s zPopen._save_inputcCs|jdkrtj|j|dS)zSend a signal to the process.N)r rrlr)rrrrrr<s cCs|jtjdS)z/Terminate the process with SIGTERM N)rrr)rrrrrBscCs|jtjdS)z*Kill the process with SIGKILL N)rrSIGKILL)rrrrrlGsz Popen.killr)NN)NN)NN)2rrrrrrrrrrrArBrrr=rrr|r}rrrrrrr<rZ WAIT_OBJECT_0rr@rkrrrrrlr WIFSIGNALEDWTERMSIG WIFEXITED WEXITSTATUS WIFSTOPPEDWSTOPSIGr r rrZECHILDrrrrrrr!2sd+  1H @ 46 " 4a r)>rrAplatformrrrrrr rrrr Exceptionrr rrrr<rrr!r  ImportErrorZdummy_threadingrbr#rr rZSelectSelector__all__r,r-r.r/r0r1r2r3rgr8r4r?rDr"r#r*rNrjr$r%r(objectr+r)rr&r'rr!rrrr*sr  %      (  .,!2I