Drop None from Container.get_children(). #8119

Merged
merged 1 commit into from Feb 22, 2017
Jump to file
+3 −4
Split
@@ -32,9 +32,8 @@ def set_remove_method(self, f):
self._remove_method = f
def remove(self):
- for c in cbook.flatten(self,
- scalarp=lambda x: isinstance(x,
- martist.Artist)):
+ for c in cbook.flatten(
+ self, scalarp=lambda x: isinstance(x, martist.Artist)):
c.remove()
if self._remove_method:
@@ -102,7 +101,7 @@ def pchanged(self):
func(self)
def get_children(self):
- return list(cbook.flatten(self))
+ return [child for child in cbook.flatten(self) if child is not None]
class BarContainer(Container):