mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
gh-90110: Fix the c-analyzer Tool (#102483)
Some incompatible changes had gone in, and the "ignore" lists weren't properly undated. This change fixes that. It's necessary prior to enabling test_check_c_globals, which I hope to do soon. Note that this does include moving last_resort_memory_error to PyInterpreterState. https://github.com/python/cpython/issues/90110
This commit is contained in:
parent
f9cdeb7b99
commit
8606697f49
11 changed files with 86 additions and 35 deletions
|
@ -7,13 +7,25 @@ from ._regexes import (
|
|||
)
|
||||
|
||||
|
||||
def log_match(group, m):
|
||||
def log_match(group, m, depth_before=None, depth_after=None):
|
||||
from . import _logger
|
||||
text = m.group(0)
|
||||
if text.startswith(('(', ')')) or text.endswith(('(', ')')):
|
||||
_logger.debug(f'matched <{group}> ({text!r})')
|
||||
|
||||
if m is not None:
|
||||
text = m.group(0)
|
||||
if text.startswith(('(', ')')) or text.endswith(('(', ')')):
|
||||
_logger.debug(f'matched <{group}> ({text!r})')
|
||||
else:
|
||||
_logger.debug(f'matched <{group}> ({text})')
|
||||
|
||||
elif depth_before is not None or depth_after is not None:
|
||||
if depth_before is None:
|
||||
depth_before = '???'
|
||||
elif depth_after is None:
|
||||
depth_after = '???'
|
||||
_logger.log(1, f'depth: %s -> %s', depth_before, depth_after)
|
||||
|
||||
else:
|
||||
_logger.debug(f'matched <{group}> ({text})')
|
||||
raise NotImplementedError('this should not have been hit')
|
||||
|
||||
|
||||
#############################
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue