diff options
author | Georg Brandl <georg@python.org> | 2006-09-24 12:50:24 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2006-09-24 12:50:24 (GMT) |
commit | c7986cee76cf2ffd6f8351fa8a65ce658825f70a (patch) | |
tree | b452376236b5c4464478e85c707445160a19fc38 /Lib/traceback.py | |
parent | a10d3afed2f27504768dffd3a915a7c876258505 (diff) | |
download | cpython-c7986cee76cf2ffd6f8351fa8a65ce658825f70a.zip cpython-c7986cee76cf2ffd6f8351fa8a65ce658825f70a.tar.gz cpython-c7986cee76cf2ffd6f8351fa8a65ce658825f70a.tar.bz2 |
Fix a bug in traceback.format_exception_only() that led to an error
being raised when print_exc() was called without an exception set.
In version 2.4, this printed "None", restored that behavior.
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r-- | Lib/traceback.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py index 75e1fcf..31b8255 100644 --- a/Lib/traceback.py +++ b/Lib/traceback.py @@ -170,7 +170,7 @@ def format_exception_only(etype, value): # would throw another exception and mask the original problem. if (isinstance(etype, BaseException) or isinstance(etype, types.InstanceType) or - type(etype) is str): + etype is None or type(etype) is str): return [_format_final_exc_line(etype, value)] stype = etype.__name__ |