diff options
author | Raymond Hettinger <python@rcn.com> | 2002-06-02 00:40:05 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2002-06-02 00:40:05 (GMT) |
commit | f13eb55d59d80907c9f86574ddd23bce2cb41ff3 (patch) | |
tree | 799ffe8a95c5cacd946f186f3022f380b418141d /Lib/shlex.py | |
parent | 1931ca72b5769ee686776617e2d97d839cc7d2d6 (diff) | |
download | cpython-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.py | 8 |
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) |