]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
clearer error and suggestion when c-analyzer cannot read ignored.tsv (#129423)
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>
Thu, 30 Jan 2025 11:38:52 +0000 (11:38 +0000)
committerGitHub <noreply@github.com>
Thu, 30 Jan 2025 11:38:52 +0000 (11:38 +0000)
Tools/c-analyzer/c_analyzer/datafiles.py

index d5db3bd3ed74ac30ec7b8ed5983ec2a5107ad45b..79c201a5d3b92cb3499372b7bc8d6e8357086404 100644 (file)
@@ -104,7 +104,12 @@ def _iter_ignored(infile, relroot):
                               for v in varidinfo)
         if reason in bogus:
             reason = None
-        varid = _info.DeclID.from_row(varidinfo)
+        try:
+            varid = _info.DeclID.from_row(varidinfo)
+        except BaseException as e:
+            e.add_note(f"Error occurred when processing row {varidinfo} in {infile}.")
+            e.add_note(f"Could it be that you added a row which is not tab-delimited?")
+            raise e
         varid = varid.fix_filename(relroot, formatted=False, fixroot=False)
         yield varid, reason