mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-90110: Fix the c-analyzer Tool (gh-96731)
This includes: * update the whitelists * fixes so we can stop ignoring some of the files * ensure Include/cpython/*.h get analyzed
This commit is contained in:
parent
662782e95f
commit
1756ffd66a
10 changed files with 499 additions and 118 deletions
|
@ -104,6 +104,25 @@ def format_filename(filename, relroot=USE_CWD, *,
|
|||
return filename
|
||||
|
||||
|
||||
def match_path_tail(path1, path2):
|
||||
"""Return True if one path ends the other."""
|
||||
if path1 == path2:
|
||||
return True
|
||||
if os.path.isabs(path1):
|
||||
if os.path.isabs(path2):
|
||||
return False
|
||||
return _match_tail(path1, path2)
|
||||
elif os.path.isabs(path2):
|
||||
return _match_tail(path2, path1)
|
||||
else:
|
||||
return _match_tail(path1, path2) or _match_tail(path2, path1)
|
||||
|
||||
|
||||
def _match_tail(path, tail):
|
||||
assert not os.path.isabs(tail), repr(tail)
|
||||
return path.endswith(os.path.sep + tail)
|
||||
|
||||
|
||||
##################################
|
||||
# find files
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue