mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
Replace boolean test with is None
This commit is contained in:
parent
0f4940c0a8
commit
094662a165
4 changed files with 5 additions and 5 deletions
|
@ -38,7 +38,7 @@ class NullFormatter:
|
|||
"""
|
||||
|
||||
def __init__(self, writer=None):
|
||||
if not writer:
|
||||
if writer is None:
|
||||
writer = NullWriter()
|
||||
self.writer = writer
|
||||
def end_paragraph(self, blankline): pass
|
||||
|
@ -433,7 +433,7 @@ class DumbWriter(NullWriter):
|
|||
def test(file = None):
|
||||
w = DumbWriter()
|
||||
f = AbstractFormatter(w)
|
||||
if file:
|
||||
if file is not None:
|
||||
fp = open(file)
|
||||
elif sys.argv[1:]:
|
||||
fp = open(sys.argv[1])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue