From ea7b78b5eb7b3d299def7688bf7a36eaa5a14f73 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 9 Oct 2018 16:10:49 -0400 Subject: Clarify and simplify logic in Node.get_binfo() --- src/engine/SCons/Node/__init__.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py index af98891..131953b 100644 --- a/src/engine/SCons/Node/__init__.py +++ b/src/engine/SCons/Node/__init__.py @@ -1169,13 +1169,17 @@ class Node(object, with_metaclass(NoSlotsPyPy)): binfo.bsources = [s for s in sources if s not in seen and not seen.add(s)] binfo.bsourcesigs = [s.get_ninfo() for s in binfo.bsources] - binfo.bdepends = [d for d in self.depends if d not in ignore_set] binfo.bdependsigs = [d.get_ninfo() for d in self.depends] - binfo.bimplicit = [i for i in self.implicit or [] if i not in ignore_set] - binfo.bimplicitsigs = [i.get_ninfo() for i in binfo.bimplicit] - + # Because self.implicit is initialized to None (and not empty list []) + # we have to handle this case + if not self.implicit: + binfo.bimplicit = [] + binfo.bimplicitsigs = [] + else: + binfo.bimplicit = [i for i in self.implicit if i not in ignore_set] + binfo.bimplicitsigs = [i.get_ninfo() for i in binfo.bimplicit] return binfo -- cgit v0.12