Discussion:
[Python-3000-checkins] r66348 - in python/branches/py3k: Lib/formatter.py Misc/NEWS
georg.brandl
2008-09-09 19:31:25 UTC
Permalink
Author: georg.brandl
Date: Tue Sep 9 21:31:25 2008
New Revision: 66348

Log:
Fix formatter usage of filter(). Bug #3800.


Modified:
python/branches/py3k/Lib/formatter.py
python/branches/py3k/Misc/NEWS

Modified: python/branches/py3k/Lib/formatter.py
==============================================================================
--- python/branches/py3k/Lib/formatter.py (original)
+++ python/branches/py3k/Lib/formatter.py Tue Sep 9 21:31:25 2008
@@ -255,7 +255,7 @@

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 @@
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:

Modified: python/branches/py3k/Misc/NEWS
==============================================================================
--- python/branches/py3k/Misc/NEWS (original)
+++ python/branches/py3k/Misc/NEWS Tue Sep 9 21:31:25 2008
@@ -96,6 +96,8 @@
Library
-------

+- Issue #3800: fix filter() related bug in formatter.py.
+
- Issue #874900: fix behaviour of threading module after a fork.

- Issue #3535: zipfile couldn't read some zip files larger than 2GB.
Loading...