diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2018-03-20 05:04:03 +0100 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2018-03-20 05:04:03 +0100 |
| commit | 8b60196c566585b2a49c703caa729bec54f408ab (patch) | |
| tree | 02dbfacb3807e06000ef54f61cb21c45458b33e4 /kconfiglib.py | |
| parent | e3a1a77441aefe0991a90fdb817448328cd96362 (diff) | |
Clean up some parent dependency conditionals
Diffstat (limited to 'kconfiglib.py')
| -rw-r--r-- | kconfiglib.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/kconfiglib.py b/kconfiglib.py index dffa7a8..2f1805a 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -1900,10 +1900,8 @@ class Kconfig(object): node.linenr = self._linenr # See similar code in _parse_properties() - if isinstance(parent.item, Choice): - parent_dep = parent.item - else: - parent_dep = parent.dep + parent_dep = parent.item if isinstance(parent.item, Choice) \ + else parent.dep node.dep = self._make_and(parent_dep, self._parse_expr(True)) @@ -2248,10 +2246,10 @@ class Kconfig(object): # as the value (mode) of the choice limits the visibility of the # contained choice symbols. Due to the similar interface, Choice works # as a drop-in replacement for Symbol here. - if isinstance(node.parent.item, Choice): - node.dep = self._make_and(node.dep, node.parent.item) - else: - node.dep = self._make_and(node.dep, node.parent.dep) + node.dep = self._make_and( + node.dep, + node.parent.item if isinstance(node.parent.item, Choice) + else node.parent.dep) if isinstance(node.item, (Symbol, Choice)): if isinstance(node.item, Symbol): |
