summaryrefslogtreecommitdiff
path: root/mesonbuild/rewriter.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz93@gmail.com>2024-02-12 17:38:56 -0500
committerEli Schwartz <eschwartz93@gmail.com>2024-02-12 18:52:43 -0500
commit4e83675bf80b0b134ef4035acce747722e9def73 (patch)
tree794bb35d25a8bd3e20238387c889d9d5d1fa61c3 /mesonbuild/rewriter.py
parent6e1556028c15ba92fff32ad68c88edf143d42c16 (diff)
downloadmeson-4e83675bf80b0b134ef4035acce747722e9def73.tar.gz
rewriter: remove never-used default None when parsing arguments
The add_arguments function is always called with a formatter in mesonmain.py, and if it were not, then it would be incorrect when calling argparse itself -- because formatter_class cannot be None, and defaults to its own builtin one. This violates None-safety.
Diffstat (limited to 'mesonbuild/rewriter.py')
-rw-r--r--mesonbuild/rewriter.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/rewriter.py b/mesonbuild/rewriter.py
index 626551014..680eed1f8 100644
--- a/mesonbuild/rewriter.py
+++ b/mesonbuild/rewriter.py
@@ -25,7 +25,7 @@ class RewriterException(MesonException):
# Note: when adding arguments, please also add them to the completion
# scripts in $MESONSRC/data/shell-completions/
-def add_arguments(parser, formatter=None):
+def add_arguments(parser, formatter):
parser.add_argument('-s', '--sourcedir', type=str, default='.', metavar='SRCDIR', help='Path to source directory.')
parser.add_argument('-V', '--verbose', action='store_true', default=False, help='Enable verbose output')
parser.add_argument('-S', '--skip-errors', dest='skip', action='store_true', default=False, help='Skip errors instead of aborting')