diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2017-11-10 08:37:42 +0100 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2017-11-10 08:40:14 +0100 |
| commit | 5c2a3458a51a78665adbebd3ce64d2ea0f95718d (patch) | |
| tree | dee6b4bdb71f0dfd42b3d9d1d1190ac4434945eb | |
| parent | bd531eb941b71ebd97623f24ae31b0763bab0c54 (diff) | |
Simplify m->y visibility promotion
Can use the magic .type attribute to check for modules being disabled.
Also remove note about infinite recursion. Pretty sure anything that
would cause infinite recursion here would be a proper circular
dependency (like MODULES depending on m).
| -rw-r--r-- | kconfiglib.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/kconfiglib.py b/kconfiglib.py index 1977047..07b9f81 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -3627,11 +3627,9 @@ def _get_visibility(sc): # Choice symbols with m visibility are not visible in y mode return 0 - # Promote m to y if we're dealing with a non-tristate. This might lead to - # infinite recursion if something really weird is done with MODULES, but - # it's not a problem in practice. - if vis == 1 and \ - (sc.orig_type != TRISTATE or not sc.kconfig.modules.tri_value): + # Promote m to y if we're dealing with a non-tristate (possibly due to + # modules being disabled) + if vis == 1 and sc.type != TRISTATE: return 2 return vis |
