diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-06-13 16:43:41 +1200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-14 12:56:32 +0100 |
commit | d36fdea1a7f32d97187e0e9e6d701ae8fa304e8f (patch) | |
tree | 7bd15158e85951c2a6120955d8a289dcccd8c57b /scripts/contrib/devtool-stress.py | |
parent | ad92ed8e4f7f48a3d212962531d596b36f6b284f (diff) | |
download | openembedded-core-d36fdea1a7f32d97187e0e9e6d701ae8fa304e8f.tar.gz openembedded-core-d36fdea1a7f32d97187e0e9e6d701ae8fa304e8f.tar.bz2 openembedded-core-d36fdea1a7f32d97187e0e9e6d701ae8fa304e8f.zip |
scripts: ensure not specifying subcommand shows help text
With Python 2, argparse subparsers behaviour in Python 2 was to print
the usage information if the subparsers argument wasn't specified.
However, with Python 3.2.3 and later a subparsers argument is not
required by default, leading to errors when no arguments are specified:
AttributeError: 'Namespace' object has no attribute 'func'
Restore the previous desired behaviour of showing the help text for
devtool, recipetool and the devtool-stress script by setting
subparsers.required to True.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/contrib/devtool-stress.py')
-rwxr-xr-x | scripts/contrib/devtool-stress.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/contrib/devtool-stress.py b/scripts/contrib/devtool-stress.py index 2723491b4a..ab77a2d1f6 100755 --- a/scripts/contrib/devtool-stress.py +++ b/scripts/contrib/devtool-stress.py @@ -213,6 +213,7 @@ def main(): parser.add_argument('-s', '--skip', help='Skip specified recipes (comma-separated without spaces, wildcards allowed)', metavar='PNLIST') parser.add_argument('-c', '--skip-classes', help='Skip recipes inheriting specified classes (comma-separated) - default %(default)s', metavar='CLASSLIST', default='native,nativesdk,cross,cross-canadian,image,populate_sdk,meta,packagegroup') subparsers = parser.add_subparsers(title='subcommands', metavar='<subcommand>') + subparsers.required = True parser_modify = subparsers.add_parser('modify', help='Run "devtool modify" followed by a build with bitbake on matching recipes', |