From 21bfa1f21eddfa174ddc2368a759a21476486af8 Mon Sep 17 00:00:00 2001 From: William Lachance Date: Thu, 30 May 2013 11:04:26 -0400 Subject: [PATCH] Bug 877265 - Make dmcli parseable by python 2.6;r=ahal --- testing/mozbase/mozdevice/mozdevice/dmcli.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/testing/mozbase/mozdevice/mozdevice/dmcli.py b/testing/mozbase/mozdevice/mozdevice/dmcli.py index ccd20fb87e2..2d84b2a5b10 100644 --- a/testing/mozbase/mozdevice/mozdevice/dmcli.py +++ b/testing/mozbase/mozdevice/mozdevice/dmcli.py @@ -168,7 +168,14 @@ class DMCli(object): subparser = subparsers.add_parser(commandname, help=commandprops['help']) if commandprops.get('args'): for arg in commandprops['args']: - kwargs = { k: v for k,v in arg.items() if k is not 'name' } + # this is more elegant but doesn't work in python 2.6 + # (which we still use on tbpl @ mozilla where we install + # this package) + # kwargs = { k: v for k,v in arg.items() if k is not 'name' } + kwargs = {} + for (k, v) in arg.items(): + if k is not 'name': + kwargs[k] = v subparser.add_argument(arg['name'], **kwargs) subparser.set_defaults(func=commandprops['function'])