diff options
author | Raymond Hettinger <python@rcn.com> | 2002-06-02 03:04:52 +0000 |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2002-06-02 03:04:52 +0000 |
commit | 8e43e185994c12535978ad2204e2da2019ae311c (patch) | |
tree | 3408a14e3dad6b2f254db2f12f7b56745b07d2c2 /Lib/traceback.py | |
parent | 2c2c5dff0241755fee977819319bec85f729d5be (diff) | |
download | cpython-8e43e185994c12535978ad2204e2da2019ae311c.tar.gz |
Replaced boolean tests with is None.
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r-- | Lib/traceback.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py index 70b16067b9..c22f576798 100644 --- a/Lib/traceback.py +++ b/Lib/traceback.py @@ -16,7 +16,7 @@ def _print(file, str='', terminator='\n'): def print_list(extracted_list, file=None): """Print the list of tuples as returned by extract_tb() or extract_stack() as a formatted stack trace to the given file.""" - if not file: + if file is None: file = sys.stderr for filename, lineno, name, line in extracted_list: _print(file, @@ -51,7 +51,7 @@ def print_tb(tb, limit=None, file=None): 'file' should be an open file or file-like object with a write() method. """ - if not file: + if file is None: file = sys.stderr if limit is None: if hasattr(sys, 'tracebacklimit'): @@ -116,7 +116,7 @@ def print_exception(etype, value, tb, limit=None, file=None): occurred with a caret on the next line indicating the approximate position of the error. """ - if not file: + if file is None: file = sys.stderr if tb: _print(file, 'Traceback (most recent call last):') @@ -203,7 +203,7 @@ def print_exc(limit=None, file=None): """Shorthand for 'print_exception(sys.exc_type, sys.exc_value, sys.exc_traceback, limit, file)'. (In fact, it uses sys.exc_info() to retrieve the same information in a thread-safe way.)""" - if not file: + if file is None: file = sys.stderr try: etype, value, tb = sys.exc_info() @@ -214,7 +214,7 @@ def print_exc(limit=None, file=None): def print_last(limit=None, file=None): """This is a shorthand for 'print_exception(sys.last_type, sys.last_value, sys.last_traceback, limit, file)'.""" - if not file: + if file is None: file = sys.stderr print_exception(sys.last_type, sys.last_value, sys.last_traceback, limit, file) |