Lines Matching +full:wasm32 +full:- +full:unknown +full:- +full:emscripten
1 # subprocess - Subprocesses with accessible I/O streams
5 # Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se>
23 ---------
69 # use presence of msvcrt to detect Windows-like platforms (see bpo-8110)
77 # wasm32-emscripten and wasm32-wasi do not support processes
78 _can_fork_exec = sys.platform not in {"emscripten", "wasi"}
128 returns a non-zero exit status.
143 self.cmd, signal.Signals(-self.returncode))
145 return "Command '%s' died with unknown signal %d." % (
146 self.cmd, -self.returncode)
148 return "Command '%s' returned non-zero exit status %d." % (
255 # [1] https://docs.microsoft.com/en-us/windows/desktop/ProcThread/
256 # creating-processes
281 PIPE = -1
282 STDOUT = -2
283 DEVNULL = -3
291 """Return a list of command-line arguments reproducing the current
296 args.append('-' + 'O' * value)
301 """Return a list of command-line arguments reproducing the current
312 # -O is handled in _optim_args_from_interpreter_flags()
318 args.append('-' + opt * v)
321 args.append('-I')
324 args.append('-E')
326 args.append('-s')
328 args.append('-P')
330 # -W options
343 args.append('-W' + opt)
345 # -X options
347 args.extend(('-X', 'dev'))
356 args.extend(('-X', arg))
376 return "utf-8"
387 retcode = call(["ls", "-l"])
406 check_call(["ls", "-l"])
420 If the exit code was non-zero it raises a CalledProcessError. The
426 >>> check_output(["ls", "-l", "/dev/null"])
427 b'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n'
432 >>> check_output(["/bin/sh", "-c",
433 ... "ls -l non_existent_file ; exit 0"],
442 >>> check_output(["sed", "-e", "s/foo/bar/"],
500 """Raise CalledProcessError if the exit code is non-zero."""
515 If check is True and the exit code was non-zero, it raises a
603 # http://msdn.microsoft.com/en-us/library/17w5ykft.aspx
605 # "Parsing C++ Command-Line Arguments"
653 return a 2-tuple (status, output). The locale encoding is used
668 (-15, '')
677 if data[-1:] == '\n':
678 data = data[:-1]
723 # reject unknown format
743 # These are primarily fail-safe knobs for negatives. A True value does not
807 def __init__(self, args, bufsize=-1, executable=None,
814 encoding=None, errors=None, text=None, umask=-1, pipesize=-1,
826 # code must re-check self.returncode to see if another thread just
833 bufsize = -1 # Restore default
838 pipesize = -1 # Restore default
891 bufsize = -1
896 process_group = -1 # The internal APIs are int-only
979 # ------ -----
980 # p2cwrite ---stdin---> p2cread
981 # c2pread <--stdout--- c2pwrite
982 # errread <--stderr--- errwrite
987 # are -1 when not using PIPEs. The child objects are -1
1001 if p2cwrite != -1:
1003 if c2pread != -1:
1005 if errread != -1:
1009 if p2cwrite != -1:
1015 if c2pread != -1:
1020 if errread != -1:
1078 # compatibility. bpo-31756
1148 # bpo-19612, bpo-30418: On Windows, stdin.write() fails
1167 Read data from stdout and stderr, until end-of-file is
1244 return endtime - _time()
1291 if p2cread != -1:
1293 if c2pwrite != -1:
1295 if errwrite != -1:
1298 if p2cread != -1 and p2cwrite != -1 and p2cread != devnull_fd:
1300 if c2pwrite != -1 and c2pread != -1 and c2pwrite != devnull_fd:
1302 if errwrite != -1 and errread != -1 and errwrite != devnull_fd:
1340 return (-1, -1, -1, -1, -1, -1)
1342 p2cread, p2cwrite = -1, -1
1343 c2pread, c2pwrite = -1, -1
1344 errread, errwrite = -1, -1
1363 # Assuming file-like object
1383 # Assuming file-like object
1405 # Assuming file-like object
1458 raise TypeError('path-like args is not allowed when '
1471 # bpo-34044: Copy STARTUPINFO since it is modified above,
1475 use_std_handles = -1 not in (p2cread, c2pwrite, errwrite)
1513 # gh-101283: without a fully-qualified path, before Windows
1690 p2cread, p2cwrite = -1, -1
1691 c2pread, c2pwrite = -1, -1
1692 errread, errwrite = -1, -1
1707 # Assuming file-like object
1722 # Assuming file-like object
1733 if c2pwrite != -1:
1742 # Assuming file-like object
1770 if fd != -1:
1777 if fd != -1:
1804 raise TypeError('path-like args is not allowed when '
1814 args = [unix_shell, "-c"] + args
1829 and (p2cread == -1 or p2cread > 2)
1830 and (c2pwrite == -1 or c2pwrite > 2)
1831 and (errwrite == -1 or errwrite > 2)
1833 and process_group == -1
1962 self.returncode = -_WSTOPSIG(sts)
2023 delay = 0.0005 # 500 us -> initial delay of 1 ms
2111 # XXX Rewrite these to use non-blocking I/O on the file
2171 # bpo-38630: Polling reduces the risk of sending a signal to the
2198 # Suppress the race condition error; bpo-40550.