# HG changeset patch # User Paul Boddie # Date 1367425884 -7200 # Node ID 528be963f41a5ec9f28d8886aeb9706dcfc94439 # Parent 098cf40197a39660f20c505bc0244ba70e43c1e8 Fixed the accidental exclusion of modules from the deduction process. diff -r 098cf40197a3 -r 528be963f41a micropython/deduce.py --- a/micropython/deduce.py Sun Apr 28 19:56:18 2013 +0200 +++ b/micropython/deduce.py Wed May 01 18:31:24 2013 +0200 @@ -68,14 +68,20 @@ access operations. """ - if not used_by_unit(node): - return - self.units.append(node.unit) self.dispatch(node.node) self.units.pop() - visitModule = visitClass = visitFunction = _visitUnit + def _visitOptionalUnit(self, node): + + "Optionally visit a unit, depending on whether it is used." + + if not used_by_unit(node): + return + self._visitUnit(node) + + visitModule = _visitUnit + visitClass = visitFunction = _visitOptionalUnit def _visitAttr(self, node):