summaryrefslogtreecommitdiff
path: root/kconfiglib.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2015-06-15 18:16:21 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2015-06-15 18:26:37 +0200
commit8b747d3329d4ae4287556b2b27f2f71ad13fee13 (patch)
tree53bd7fe3c1eda496d708dae971136f408ec7a7ad /kconfiglib.py
parent23c9e6a67227064734f88899a771e6ce7e6604f8 (diff)
Merge _has_modules() into _eval_expr().
Single trivial user.
Diffstat (limited to 'kconfiglib.py')
-rw-r--r--kconfiglib.py24
1 files changed, 9 insertions, 15 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index fc719a0..588b781 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -1383,13 +1383,15 @@ class Config(object):
"m" or "y"."""
res = self._eval_expr_2(expr)
- # Promote "m" to "y" if we're running without modules. Internally, "m"
- # is often rewritten to "m" && MODULES by both the C implementation and
- # kconfiglib, which takes care of cases where "m" should be false if
- # we're running without modules.
- if res == "m" and not self._has_modules():
- return "y"
-
+ if res == "m":
+ # Promote "m" to "y" if we're running without modules.
+ #
+ # Internally, "m" is often rewritten to "m" && MODULES by both the
+ # C implementation and Kconfiglib, which takes care of cases where
+ # "m" should be demoted to "n" instead.
+ modules_sym = self.syms.get("MODULES")
+ if modules_sym is None or modules_sym.get_value() != "y":
+ return "y"
return res
def _eval_expr_2(self, expr):
@@ -1464,14 +1466,6 @@ class Config(object):
return e1_eval if tri_greater(e1_eval, e2_eval) else e2_eval
#
- # Methods related to the MODULES symbol
- #
-
- def _has_modules(self):
- modules_sym = self.syms.get("MODULES")
- return (modules_sym is not None) and (modules_sym.get_value() == "y")
-
- #
# Dependency tracking
#