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

Function handling_errors

Tools/c-analyzer/c_parser/preprocessor/__init__.py:203–223  ·  view source on GitHub ↗
(ignore_exc=None, *, log_err=None)

Source from the content-addressed store, hash-verified

201
202@contextlib.contextmanager
203def handling_errors(ignore_exc=None, *, log_err=None):
204 try:
205 yield
206 except _errors.OSMismatchError as exc:
207 if not ignore_exc(exc):
208 raise # re-raise
209 if log_err is not None:
210 log_err(f'<OS mismatch (expected {" or ".join(exc.expected)})>')
211 return None
212 except _errors.MissingDependenciesError as exc:
213 if not ignore_exc(exc):
214 raise # re-raise
215 if log_err is not None:
216 log_err(f'<missing dependency {exc.missing}')
217 return None
218 except _errors.ErrorDirectiveError as exc:
219 if not ignore_exc(exc):
220 raise # re-raise
221 if log_err is not None:
222 log_err(exc)
223 return None
224
225
226##################################

Callers 1

preprocessFunction · 0.85

Calls 2

ignore_excFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…