summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2002-06-01 01:29:16 (GMT)
committerRaymond Hettinger <python@rcn.com>2002-06-01 01:29:16 (GMT)
commit094662a16542d1cc56713b35dde39089490dec35 (patch)
treeeb433a4bebe8dc9eb28de9f7655f8fab24498a52 /Lib
parent0f4940c0a8d2ac66ccf90fb12739967915043406 (diff)
downloadcpython-094662a16542d1cc56713b35dde39089490dec35.zip
cpython-094662a16542d1cc56713b35dde39089490dec35.tar.gz
cpython-094662a16542d1cc56713b35dde39089490dec35.tar.bz2
Replace boolean test with is None
Diffstat (limited to 'Lib')
-rw-r--r--Lib/formatter.py4
-rw-r--r--Lib/ftplib.py2
-rw-r--r--Lib/gettext.py2
-rw-r--r--Lib/hmac.py2
4 files changed, 5 insertions, 5 deletions
diff --git a/Lib/formatter.py b/Lib/formatter.py
index 75f4718..ccbbdf1 100644
--- a/Lib/formatter.py
+++ b/Lib/formatter.py
@@ -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])
diff --git a/Lib/ftplib.py b/Lib/ftplib.py
index 21b9e52..4a3d884 100644
--- a/Lib/ftplib.py
+++ b/Lib/ftplib.py
@@ -659,7 +659,7 @@ class Netrc:
__defacct = None
def __init__(self, filename=None):
- if not filename:
+ if filename is None:
if os.environ.has_key("HOME"):
filename = os.path.join(os.environ["HOME"],
".netrc")
diff --git a/Lib/gettext.py b/Lib/gettext.py
index 0bea9ed..253b6d8 100644
--- a/Lib/gettext.py
+++ b/Lib/gettext.py
@@ -104,7 +104,7 @@ class NullTranslations:
self._info = {}
self._charset = None
self._fallback = None
- if fp:
+ if fp is not None:
self._parse(fp)
def _parse(self, fp):
diff --git a/Lib/hmac.py b/Lib/hmac.py
index c9e4ae8..ba0a63c 100644
--- a/Lib/hmac.py
+++ b/Lib/hmac.py
@@ -46,7 +46,7 @@ class HMAC:
key = key + chr(0) * (blocksize - len(key))
self.outer.update(_strxor(key, opad))
self.inner.update(_strxor(key, ipad))
- if (msg):
+ if msg is not None:
self.update(msg)
## def clear(self):