URL: https://github.com/freeipa/freeipa/pull/909 Author: MartinBasti Title: #909: IPAOptionParser: fix dict comprehension Action: opened
PR body: """ The statement can be simplified and be more resources friendly """ To pull the PR as Git branch: git remote add ghfreeipa https://github.com/freeipa/freeipa git fetch ghfreeipa pull/909/head:pr909 git checkout pr909
From eea18338ac36c3d4a9d44fe671d47eafd15f936d Mon Sep 17 00:00:00 2001 From: Martin Basti <mba...@redhat.com> Date: Mon, 10 Jul 2017 14:54:10 +0200 Subject: [PATCH] IPAOptionParser: fix dict comprehension The statement can be simplified and be more resources friendly --- ipapython/config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ipapython/config.py b/ipapython/config.py index 19abfc51ee..6e53472e08 100644 --- a/ipapython/config.py +++ b/ipapython/config.py @@ -114,7 +114,10 @@ def get_safe_opts(self, opts): Returns all options except those with sensitive=True in the same fashion as parse_args would """ - all_opts_dict = dict([ (o.dest, o) for o in self._get_all_options() if hasattr(o, 'sensitive') ]) + all_opts_dict = { + o.dest: o for o in self._get_all_options() + if hasattr(o, 'sensitive') + } safe_opts_dict = {} for option, value in opts.__dict__.items():
_______________________________________________ FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org