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

Function _resolve_ignored

Tools/c-analyzer/cpython/_capi.py:354–384  ·  view source on GitHub ↗
(ignored)

Source from the content-addressed store, hash-verified

352
353
354def _resolve_ignored(ignored):
355 if isinstance(ignored, str):
356 ignored = [ignored]
357 for raw in ignored:
358 if isinstance(raw, str):
359 if raw.startswith('|'):
360 yield raw[1:]
361 elif raw.startswith('<') and raw.endswith('>'):
362 filename = raw[1:-1]
363 try:
364 infile = open(filename)
365 except Exception as exc:
366 logger.error(f'ignore file failed: {exc}')
367 continue
368 logger.log(1, f'reading ignored names from {filename!r}')
369 with infile:
370 for line in infile:
371 if not line:
372 continue
373 if line[0].isspace():
374 continue
375 line = line.partition('#')[0].rstrip()
376 if line:
377 # XXX Recurse?
378 yield line
379 else:
380 raw = raw.strip()
381 if raw:
382 yield raw
383 else:
384 raise NotImplementedError
385
386
387def _collate(items, groupby, includeempty):

Callers 1

resolve_filterFunction · 0.85

Calls 9

isspaceMethod · 0.80
openFunction · 0.50
startswithMethod · 0.45
endswithMethod · 0.45
errorMethod · 0.45
logMethod · 0.45
rstripMethod · 0.45
partitionMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…