1.1 --- a/branching.py Wed Feb 22 17:19:02 2017 +0100
1.2 +++ b/branching.py Thu Feb 23 16:37:43 2017 +0100
1.3 @@ -4,7 +4,7 @@
1.4 Track attribute usage for names.
1.5
1.6 Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013,
1.7 - 2014, 2015, 2016 Paul Boddie <paul@boddie.org.uk>
1.8 + 2014, 2015, 2016, 2017 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -75,7 +75,11 @@
1.13 if name in self.assignments:
1.14 return [self]
1.15 else:
1.16 - return [b for b in self.get_all_suppliers(name) if name in b.assignments]
1.17 + sources = []
1.18 + for b in self.get_all_suppliers(name):
1.19 + if name in b.assignments:
1.20 + sources.append(b)
1.21 + return sources
1.22
1.23 def set_usage(self, name, attrname, invocation=False, assignment=False):
1.24
1.25 @@ -597,7 +601,10 @@
1.26
1.27 d = {}
1.28 for name, branches in self.assignments.items():
1.29 - d[name] = [branch.values.get(name) for branch in branches]
1.30 + l = []
1.31 + for branch in branches:
1.32 + l.append(branch.values.get(name))
1.33 + d[name] = l
1.34 return d
1.35
1.36 # Special objects.