MCPcopy Index your code
hub / github.com/python/cpython / preprocess

Function preprocess

Tools/c-analyzer/c_parser/preprocessor/common.py:53–68  ·  view source on GitHub ↗
(tool, filename, cwd=None, **kwargs)

Source from the content-addressed store, hash-verified

51
52
53def preprocess(tool, filename, cwd=None, **kwargs):
54 argv = _build_argv(tool, filename, **kwargs)
55 logger.debug(' '.join(shlex.quote(v) for v in argv))
56
57 # Make sure the OS is supported for this file.
58 if (_expected := is_os_mismatch(filename)):
59 error = None
60 raise OSMismatchError(filename, _expected, argv, error, TOOL)
61
62 # Run the command.
63 with converted_error(tool, argv, filename):
64 # We use subprocess directly here, instead of calling the
65 # distutil compiler object's preprocess() method, since that
66 # one writes to stdout/stderr and it's simpler to do it directly
67 # through subprocess.
68 return run_cmd(argv, cwd=cwd)
69
70
71def _build_argv(

Callers

nothing calls this directly

Calls 8

_build_argvFunction · 0.85
is_os_mismatchFunction · 0.85
OSMismatchErrorClass · 0.85
converted_errorFunction · 0.85
run_cmdFunction · 0.85
quoteMethod · 0.80
debugMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…