summaryrefslogtreecommitdiffstats
path: root/Lib/shlex.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2002-06-02 00:40:05 (GMT)
committerRaymond Hettinger <python@rcn.com>2002-06-02 00:40:05 (GMT)
commitf13eb55d59d80907c9f86574ddd23bce2cb41ff3 (patch)
tree799ffe8a95c5cacd946f186f3022f380b418141d /Lib/shlex.py
parent1931ca72b5769ee686776617e2d97d839cc7d2d6 (diff)
downloadcpython-f13eb55d59d80907c9f86574ddd23bce2cb41ff3.zip
cpython-f13eb55d59d80907c9f86574ddd23bce2cb41ff3.tar.gz
cpython-f13eb55d59d80907c9f86574ddd23bce2cb41ff3.tar.bz2
Replace boolean test with is None.
Diffstat (limited to 'Lib/shlex.py')
-rw-r--r--Lib/shlex.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/shlex.py b/Lib/shlex.py
index e50b9ad..7ffa79c 100644
--- a/Lib/shlex.py
+++ b/Lib/shlex.py
@@ -12,7 +12,7 @@ __all__ = ["shlex"]
class shlex:
"A lexical analyzer class for simple shell-like syntaxes."
def __init__(self, instream=None, infile=None):
- if instream:
+ if instream is not None:
self.instream = instream
self.infile = infile
else:
@@ -47,7 +47,7 @@ class shlex:
self.instream = newstream
self.lineno = 1
if self.debug:
- if newfile:
+ if newfile is not None:
print 'shlex: pushing to file %s' % (self.infile,)
else:
print 'shlex: pushing to stream %s' % (self.instream,)
@@ -188,9 +188,9 @@ class shlex:
def error_leader(self, infile=None, lineno=None):
"Emit a C-compiler-like, Emacs-friendly error-message leader."
- if not infile:
+ if infile is None:
infile = self.infile
- if not lineno:
+ if lineno is None:
lineno = self.lineno
return "\"%s\", line %d: " % (infile, lineno)