From 53497d89db380a241012b3b72253eaf00282658c Mon Sep 17 00:00:00 2001 From: "biao716.wang" Date: Mon, 14 Nov 2022 15:36:09 +0900 Subject: [PATCH] fix run error with ArgumentParser in python3.x Change-Id: Iefb5d539110064e12492dbfeaa8bd6fd76bf2a4b Signed-off-by: biao716.wang --- bsr/bsr/bsr | 2 ++ tools/gbs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/bsr/bsr/bsr b/bsr/bsr/bsr index 6664307..b897d2c 100755 --- a/bsr/bsr/bsr +++ b/bsr/bsr/bsr @@ -332,6 +332,8 @@ def argument_parsing(argv): 'ex) download/29129249/html/DependsGraph in case of QuickBuild.') subparsers = parser.add_subparsers(dest='subcommands') + #for python3.x, argparser logic is changed, if without the below option, it will not normally exit with error info. + subparsers.required = True preview = subparsers.add_parser('preview', parents=[base]) preview.add_argument('-o', '--output', action='store', dest='output_file', default=None, \ diff --git a/tools/gbs b/tools/gbs index e4ee5ea..69739f1 100755 --- a/tools/gbs +++ b/tools/gbs @@ -699,6 +699,8 @@ def main(argv): # Create parsers for subcommands subparsers = parser.add_subparsers(title='subcommands') + #for python3.x, argparser logic is changed, if without the below option, it will not normally exit with error info. + subparsers.required = True # collect aliases aliases = {} -- 2.34.1