From fbf31fac751c0d76d2f55a0fe649ade5bafed292 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Thu, 14 Jun 2018 12:00:44 +0200 Subject: Fix MenuNode.referenced() on Kconfig.top_node The property lists weren't created for Kconfig.top_node, making referenced() crash. Add a MenuNode constructor and create the property lists there instead of in _parse_properties(). --- kconfiglib.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'kconfiglib.py') diff --git a/kconfiglib.py b/kconfiglib.py index af5415d..609ba7d 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -2114,13 +2114,6 @@ class Kconfig(object): # below. node.dep = self.y - # Properties added at this location. A local 'depends on' only applies - # to these, in case a symbol is defined in multiple locations. - node.defaults = [] - node.selects = [] - node.implies = [] - node.ranges = [] - while self._next_line(): t0 = self._next_token() if t0 is None: @@ -4171,6 +4164,15 @@ class MenuNode(object): "ranges" ) + def __init__(self): + # Properties defined on this particular menu node. A local 'depends on' + # only applies to these, in case a symbol is defined in multiple + # locations. + self.defaults = [] + self.selects = [] + self.implies = [] + self.ranges = [] + def referenced(self): """ Returns a set() of all symbols and choices referenced in the properties -- cgit v1.2.3