summaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-10-07 21:29:49 +0000
committerGuido van Rossum <guido@python.org>1996-10-07 21:29:49 +0000
commit68aa1c76c1f6de9eb11f4d6b1eb8ecf531585159 (patch)
tree5ca766768ce2ff5186f7ecf7699020ebc62ac259 /Lib
parent7831dfbdeab011f5a57fa18e328f490ae653e07e (diff)
downloadcpython-68aa1c76c1f6de9eb11f4d6b1eb8ecf531585159.tar.gz
Add provisions to set the (to be documented!) instance variable
'writer' of the NullFormatter to the writter passed in, or to a NullWriter if none (or None) is passed in.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/formatter.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/formatter.py b/Lib/formatter.py
index c192e20ddb..79be0f64e3 100644
--- a/Lib/formatter.py
+++ b/Lib/formatter.py
@@ -10,7 +10,10 @@ AS_IS = None
class NullFormatter:
- def __init__(self, writer): pass
+ def __init__(self, writer=None):
+ if not writer:
+ writer = NullWriter()
+ self.writer = writer
def end_paragraph(self, blankline): pass
def add_line_break(self): pass
def add_hor_rule(self, abswidth=None, percentwidth=1.0,