[libcxx-commits] [libcxx] [libc++] Use ValueError instead of non-existent ArgumentError (PR #179526)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 3 10:47:24 PST 2026


https://github.com/ldionne created https://github.com/llvm/llvm-project/pull/179526

ArgumentError does not exist. argparse.ArgumentError does exist, but that is not what we want to use. I presume this was never caught because we never execute that line.

>From 8715ee66b4d30a5e7de9111d26d3210fd4ee6041 Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Tue, 3 Feb 2026 13:46:05 -0500
Subject: [PATCH] [libc++] Use ValueError instead of non-existent ArgumentError

ArgumentError does not exist. argparse.ArgumentError does exist, but
that is not what we want to use. I presume this was never caught
because we never execute that line.
---
 libcxx/test/libcxx-03/transitive_includes/to_csv.py | 2 +-
 libcxx/test/libcxx/transitive_includes/to_csv.py    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libcxx/test/libcxx-03/transitive_includes/to_csv.py b/libcxx/test/libcxx-03/transitive_includes/to_csv.py
index 69d94deedf6f5..3035ff6cfe5c8 100755
--- a/libcxx/test/libcxx-03/transitive_includes/to_csv.py
+++ b/libcxx/test/libcxx-03/transitive_includes/to_csv.py
@@ -28,7 +28,7 @@ def parse_line(line: str) -> Tuple[int, str]:
     """
     match = re.match(r"(\.+) (.+)", line)
     if not match:
-        raise ArgumentError(f"Line {line} contains invalid data.")
+        raise ValueError(f"Line {line} contains invalid data.")
 
     # The number of periods in front of the header name is the nesting level of
     # that header.
diff --git a/libcxx/test/libcxx/transitive_includes/to_csv.py b/libcxx/test/libcxx/transitive_includes/to_csv.py
index 69d94deedf6f5..3035ff6cfe5c8 100755
--- a/libcxx/test/libcxx/transitive_includes/to_csv.py
+++ b/libcxx/test/libcxx/transitive_includes/to_csv.py
@@ -28,7 +28,7 @@ def parse_line(line: str) -> Tuple[int, str]:
     """
     match = re.match(r"(\.+) (.+)", line)
     if not match:
-        raise ArgumentError(f"Line {line} contains invalid data.")
+        raise ValueError(f"Line {line} contains invalid data.")
 
     # The number of periods in front of the header name is the nesting level of
     # that header.



More information about the libcxx-commits mailing list