From: biao716.wang Date: Mon, 14 Nov 2022 06:36:09 +0000 (+0900) Subject: fix run error with ArgumentParser in python3.x X-Git-Tag: accepted/tools/devbase/tools/20250527.103741~18^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=53497d89db380a241012b3b72253eaf00282658c;p=tools%2Fgbs.git fix run error with ArgumentParser in python3.x Change-Id: Iefb5d539110064e12492dbfeaa8bd6fd76bf2a4b Signed-off-by: biao716.wang --- 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 = {}