MCPcopy Index your code
hub / github.com/nodejs/node / _CheckPythonLiterals

Function _CheckPythonLiterals

deps/v8/PRESUBMIT.py:144–161  ·  view source on GitHub ↗

Checks that all .pyl files are valid python literals.

(input_api, output_api)

Source from the content-addressed store, hash-verified

142
143
144def _CheckPythonLiterals(input_api, output_api):
145 """Checks that all .pyl files are valid python literals."""
146 affected_files = [
147 af for af in input_api.AffectedFiles()
148 if af.LocalPath().endswith('.pyl')
149 ]
150
151 results = []
152 for af in affected_files:
153 try:
154 ast.literal_eval('\n'.join(af.NewContents()))
155 except SyntaxError as e:
156 results.append(output_api.PresubmitError(
157 f'Failed to parse python literal {af.LocalPath()}:\n' +
158 traceback.format_exc(0)
159 ))
160
161 return results
162
163
164

Callers

nothing calls this directly

Calls 3

LocalPathMethod · 0.80
joinMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…