fix run error with ArgumentParser in python3.x 39/284239/2
authorbiao716.wang <biao716.wang@samsung.com>
Mon, 14 Nov 2022 06:36:09 +0000 (15:36 +0900)
committerbiao716.wang <biao716.wang@samsung.com>
Mon, 14 Nov 2022 07:01:50 +0000 (16:01 +0900)
Change-Id: Iefb5d539110064e12492dbfeaa8bd6fd76bf2a4b
Signed-off-by: biao716.wang <biao716.wang@samsung.com>
bsr/bsr/bsr
tools/gbs

index 6664307..b897d2c 100755 (executable)
@@ -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, \
index e4ee5ea..69739f1 100755 (executable)
--- 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 = {}