diff options
author | Georg Brandl <georg@python.org> | 2008-09-09 19:31:25 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-09-09 19:31:25 (GMT) |
commit | 7cd67cc992acb659f1673706e037ee835648d60b (patch) | |
tree | 91508295990e666d4405906e4620ae5d8b991f70 /Lib/formatter.py | |
parent | 617027fba48e84d09e21f69093754c0db5820006 (diff) | |
download | cpython-7cd67cc992acb659f1673706e037ee835648d60b.zip cpython-7cd67cc992acb659f1673706e037ee835648d60b.tar.gz cpython-7cd67cc992acb659f1673706e037ee835648d60b.tar.bz2 |
Fix formatter usage of filter(). Bug #3800.
Diffstat (limited to 'Lib/formatter.py')
-rw-r--r-- | Lib/formatter.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/formatter.py b/Lib/formatter.py index bb8ad20..60e60f1 100644 --- a/Lib/formatter.py +++ b/Lib/formatter.py @@ -255,7 +255,7 @@ class AbstractFormatter: def push_margin(self, margin): self.margin_stack.append(margin) - fstack = filter(None, self.margin_stack) + fstack = [m for m in self.margin_stack if m] if not margin and fstack: margin = fstack[-1] self.writer.new_margin(margin, len(fstack)) @@ -263,7 +263,7 @@ class AbstractFormatter: def pop_margin(self): if self.margin_stack: del self.margin_stack[-1] - fstack = filter(None, self.margin_stack) + fstack = [m for m in self.margin_stack if m] if fstack: margin = fstack[-1] else: |