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

Function run_cmd

Tools/c-analyzer/c_parser/preprocessor/common.py:27–50  ·  view source on GitHub ↗
(argv, *,
            #capture_output=True,
            stdout=subprocess.PIPE,
            #stderr=subprocess.STDOUT,
            stderr=subprocess.PIPE,
            text=True,
            check=True,
            **kwargs
            )

Source from the content-addressed store, hash-verified

25
26
27def run_cmd(argv, *,
28 #capture_output=True,
29 stdout=subprocess.PIPE,
30 #stderr=subprocess.STDOUT,
31 stderr=subprocess.PIPE,
32 text=True,
33 check=True,
34 **kwargs
35 ):
36 if isinstance(stderr, str) and stderr.lower() == 'stdout':
37 stderr = subprocess.STDOUT
38
39 kw = dict(locals())
40 kw.pop('argv')
41 kw.pop('kwargs')
42 kwargs.update(kw)
43
44 # Remove LANG environment variable: the C parser doesn't support GCC
45 # localized messages
46 env = dict(os.environ)
47 env.pop('LANG', None)
48
49 proc = subprocess.run(argv, env=env, **kwargs)
50 return proc.stdout
51
52
53def preprocess(tool, filename, cwd=None, **kwargs):

Callers 9

test_invalid_utf8_argMethod · 0.85
_check_buildMethod · 0.85
_check_buildMethod · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
preprocessFunction · 0.85
convert_errorFunction · 0.85

Calls 4

lowerMethod · 0.45
popMethod · 0.45
updateMethod · 0.45
runMethod · 0.45

Tested by 1

test_invalid_utf8_argMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…