summaryrefslogtreecommitdiffstats
path: root/Lib/traceback.py
diff options
context:
space:
mode:
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2008-09-09 17:55:11 (GMT)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2008-09-09 17:55:11 (GMT)
commit54a1cc68a1e9eb81c8336634e51ae5736472e85b (patch)
tree56f1ab720b200e1b87209c0aab99d935f7723d5c /Lib/traceback.py
parent167b12b71c34e1fdf630a90adca8c77476dbac81 (diff)
downloadcpython-54a1cc68a1e9eb81c8336634e51ae5736472e85b.zip
cpython-54a1cc68a1e9eb81c8336634e51ae5736472e85b.tar.gz
cpython-54a1cc68a1e9eb81c8336634e51ae5736472e85b.tar.bz2
Issue #3812: Failed to build python if configure --without-threads.
Removed itertools usage from Lib/traceback.py, because itertools is extension module, so maybe unavailable on build process. (Lib/_dummy_thread.py uses Lib/traceback.py) Reviewed by Amaury Forgeot d'Arc.
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r--Lib/traceback.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py
index b7130d8..fac73c4 100644
--- a/Lib/traceback.py
+++ b/Lib/traceback.py
@@ -3,7 +3,6 @@
import linecache
import sys
import types
-import itertools
__all__ = ['extract_stack', 'extract_tb', 'format_exception',
'format_exception_only', 'format_list', 'format_stack',
@@ -130,7 +129,10 @@ def _iter_chain(exc, custom_tb=None, seen=None):
its.append(_iter_chain(context, None, seen))
its.append([(_context_message, None)])
its.append([(exc, custom_tb or exc.__traceback__)])
- return itertools.chain(*its)
+ # itertools.chain is in an extension module and may be unavailable
+ for it in its:
+ for x in it:
+ yield x
def print_exception(etype, value, tb, limit=None, file=None, chain=True):