summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kconfiglib.py32
1 files changed, 16 insertions, 16 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index 29e0855..d480c96 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -4561,22 +4561,22 @@ def _visibility(sc):
return vis
-def _make_depend_on(sym, expr):
- # Adds 'sym' as a dependency to all symbols in 'expr'. Constant symbols in
- # 'expr' are skipped as they can never change value anyway.
-
- if not isinstance(expr, tuple):
- # Symbol or choice
- if not expr.is_constant:
- expr._dependents.add(sym)
-
- elif expr[0] == NOT:
- _make_depend_on(sym, expr[1])
-
- else:
- # AND, OR, or relation
- _make_depend_on(sym, expr[1])
- _make_depend_on(sym, expr[2])
+def _make_depend_on(sc, expr):
+ # Adds 'sc' (symbol or choice) as a "dependee" to all symbols in 'expr'.
+ # Constant symbols in 'expr' are skipped as they can never change value
+ # anyway.
+
+ if isinstance(expr, tuple):
+ # AND, OR, NOT or relation
+ _make_depend_on(sc, expr[1])
+
+ # NOTs only have a single operand
+ if expr[0] != NOT:
+ _make_depend_on(sc, expr[2])
+
+ elif not expr.is_constant:
+ # Non-constant symbol, or choice
+ expr._dependents.add(sc)
def _expand(s):
# A predefined UNAME_RELEASE symbol is expanded in one of the 'default's of