summaryrefslogtreecommitdiffstats
path: root/Lib/traceback.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2002-06-02 03:04:52 (GMT)
committerRaymond Hettinger <python@rcn.com>2002-06-02 03:04:52 (GMT)
commit10ff706e2788a7c7ef9f8ea0108a5ede625fedad (patch)
treed2c08c7f262865884912dc04dd05b36656646851 /Lib/traceback.py
parentf13eb55d59d80907c9f86574ddd23bce2cb41ff3 (diff)
downloadcpython-10ff706e2788a7c7ef9f8ea0108a5ede625fedad.zip
cpython-10ff706e2788a7c7ef9f8ea0108a5ede625fedad.tar.gz
cpython-10ff706e2788a7c7ef9f8ea0108a5ede625fedad.tar.bz2
Replaced boolean tests with is None.
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r--Lib/traceback.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py
index 70b1606..c22f576 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)