Remove argv usage from Python scripts (#7311)

argparse will automatically read sys.argv, so we don't need to pass it
in manually. Furthermore, none of our scripts customize argv.
This commit is contained in:
Tyler Veness
2024-11-02 19:09:32 -07:00
committed by GitHub
parent 7c91b81906
commit a48f3c35f4
13 changed files with 50 additions and 56 deletions

View File

@@ -475,13 +475,8 @@ class Lib:
self.copy_upstream_src(self.wpilib_root)
def main(self, argv=sys.argv[1:]):
"""Processes the given arguments.
Keyword argument:
argv -- The arguments to process. Defaults to the arguments passed to
the program.
"""
def main(self):
"""Process arguments of upstream_utils script"""
parser = argparse.ArgumentParser(
description=f"CLI manager of the {self.name} upstream library"
)
@@ -515,7 +510,7 @@ class Lib:
help="Copies files from the upstream repository into the thirdparty directory in allwpilib",
)
args = parser.parse_args(argv)
args = parser.parse_args()
self.wpilib_root = get_repo_root()
if args.subcommand == "info":