Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ccd8b19

Browse files
committed
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.
1 parent 36fc11e commit ccd8b19

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Lib/formatter.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010

1111
class NullFormatter:
1212

13-
def __init__(self, writer): pass
13+
def __init__(self, writer=None):
14+
if not writer:
15+
writer = NullWriter()
16+
self.writer = writer
1417
def end_paragraph(self, blankline): pass
1518
def add_line_break(self): pass
1619
def add_hor_rule(self, abswidth=None, percentwidth=1.0,

0 commit comments

Comments
 (0)