Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 54a1cc6

Browse files
author
Hirokazu Yamamoto
committed
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.
1 parent 167b12b commit 54a1cc6

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

Lib/traceback.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import linecache
44
import sys
55
import types
6-
import itertools
76

87
__all__ = ['extract_stack', 'extract_tb', 'format_exception',
98
'format_exception_only', 'format_list', 'format_stack',
@@ -130,7 +129,10 @@ def _iter_chain(exc, custom_tb=None, seen=None):
130129
its.append(_iter_chain(context, None, seen))
131130
its.append([(_context_message, None)])
132131
its.append([(exc, custom_tb or exc.__traceback__)])
133-
return itertools.chain(*its)
132+
# itertools.chain is in an extension module and may be unavailable
133+
for it in its:
134+
for x in it:
135+
yield x
134136

135137

136138
def print_exception(etype, value, tb, limit=None, file=None, chain=True):

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ Tools/Demos
165165
Build
166166
-----
167167

168+
- Issue #3812: Failed to build python if configure --without-threads.
169+
168170
- Issue #3791: Remove the bsddb module from the Windows installer, and the
169171
core bsddb library from the Windows build files.
170172

0 commit comments

Comments
 (0)