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

Skip to content

Commit 61e21b5

Browse files
committed
Merged revisions 57152-57220 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r57155 | brett.cannon | 2007-08-17 11:51:57 -0700 (Fri, 17 Aug 2007) | 2 lines Clarify the comment about setting the PYTHON variable for the Doc Makefile. ........ r57156 | brett.cannon | 2007-08-17 11:59:58 -0700 (Fri, 17 Aug 2007) | 3 lines Remove news entry for test.test_support.guard_warnings_filter as it has been removed. ........ r57158 | facundo.batista | 2007-08-17 12:16:44 -0700 (Fri, 17 Aug 2007) | 9 lines Added a flag (_send_traceback_header) to the SimpleXMLRPCServer class that allows sending back exception/stack trace information about internal server errors (this flag defaults to False to avoid sending such information unless explicitly enabled). Added tests to verify behavior of this new feature (these tests are skipped on win32 because of problems with WSAEWOULDBLOCK). Renamed HTTPTestCase to SimpleServerTestCase. [GSoC - Alan McIntyre] ........ r57160 | brett.cannon | 2007-08-17 13:16:15 -0700 (Fri, 17 Aug 2007) | 2 lines Make test_warnings re-entrant. ........ r57175 | georg.brandl | 2007-08-17 23:05:56 -0700 (Fri, 17 Aug 2007) | 2 lines Fix PDB command descriptions. ........ r57182 | brett.cannon | 2007-08-18 11:30:36 -0700 (Sat, 18 Aug 2007) | 3 lines Remove Mikael as the maintainer of BeOS at his request. With no maintainer should the port be deprecated in 2.6? ........ r57199 | georg.brandl | 2007-08-19 11:43:50 -0700 (Sun, 19 Aug 2007) | 2 lines Fix stray backticks. ........ r57211 | hyeshik.chang | 2007-08-19 23:49:18 -0700 (Sun, 19 Aug 2007) | 2 lines Add cheot-ga-keut composed make-up sequence support in EUC-KR codec. ........ r57216 | guido.van.rossum | 2007-08-20 08:18:04 -0700 (Mon, 20 Aug 2007) | 4 lines Add a hack (originally devised in a slightly different form by Thomas Wouters) to prevent spurious tracebacks when a daemon thread's cleanup happens to wake up when the world around it has already been destroyed. ........
1 parent 7d6068e commit 61e21b5

11 files changed

Lines changed: 283 additions & 28 deletions

File tree

Doc/library/formatter.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ typically be provided by the application.
242242
.. method:: writer.new_font(font)
243243

244244
Set the font style. The value of *font* will be ``None``, indicating that the
245-
device's default font should be used, or a tuple of the form ``(``*size*,
246-
*italic*, *bold*, *teletype*``)``. Size will be a string indicating the size of
245+
device's default font should be used, or a tuple of the form ``(size,
246+
italic, bold, teletype)``. Size will be a string indicating the size of
247247
font that should be used; specific strings and their interpretation must be
248248
defined by the application. The *italic*, *bold*, and *teletype* values are
249249
Boolean values specifying which of those font attributes should be used.

Doc/library/pdb.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ d(own)
178178
u(p)
179179
Move the current frame one level up in the stack trace (to an older frame).
180180

181-
b(reak) [[*filename*:]*lineno*``|``*function*[, *condition*]]
181+
b(reak) [[*filename*:]\ *lineno* | *function*\ [, *condition*]]
182182
With a *lineno* argument, set a break there in the current file. With a
183183
*function* argument, set a break at the first executable statement within that
184184
function. The line number may be prefixed with a filename and a colon, to
@@ -193,7 +193,7 @@ b(reak) [[*filename*:]*lineno*``|``*function*[, *condition*]]
193193
times that breakpoint has been hit, the current ignore count, and the associated
194194
condition if any.
195195

196-
tbreak [[*filename*:]*lineno*``|``*function*[, *condition*]]
196+
tbreak [[*filename*:]\ *lineno* | *function*\ [, *condition*]]
197197
Temporary breakpoint, which is removed automatically when it is first hit. The
198198
arguments are the same as break.
199199

@@ -279,7 +279,7 @@ j(ump) *lineno*
279279
possible to jump into the middle of a :keyword:`for` loop or out of a
280280
:keyword:`finally` clause.
281281

282-
l(ist) [*first*[, *last*]]
282+
l(ist) [*first*\ [, *last*]]
283283
List source code for the current file. Without arguments, list 11 lines around
284284
the current line or continue the previous listing. With one argument, list 11
285285
lines around at that line. With two arguments, list the given range; if the
@@ -324,7 +324,7 @@ alias [*name* [command]]
324324
unalias *name*
325325
Deletes the specified alias.
326326

327-
[!]*statement*
327+
[!]\ *statement*
328328
Execute the (one-line) *statement* in the context of the current stack frame.
329329
The exclamation point can be omitted unless the first word of the statement
330330
resembles a debugger command. To set a global variable, you can prefix the

Doc/tools/sphinx-build.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313

1414
if sys.version_info[:3] < (2, 5, 0):
1515
print >>sys.stderr, """\
16-
Error: Sphinx needs to be executed with Python 2.5 or newer.
16+
Error: Sphinx needs to be executed with Python 2.5 or newer
1717
(If you run this from the Makefile, you can set the PYTHON variable
18-
to the path of an alternative interpreter executable.)
18+
to the path of an alternative interpreter executable, e.g.,
19+
``make html PYTHON=python2.5``).
1920
"""
2021
sys.exit(1)
2122

Lib/SimpleXMLRPCServer.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ def export_add(self, x, y):
104104
import BaseHTTPServer
105105
import sys
106106
import os
107+
import traceback
107108
try:
108109
import fcntl
109110
except ImportError:
@@ -451,9 +452,16 @@ def do_POST(self):
451452
response = self.server._marshaled_dispatch(
452453
data, getattr(self, '_dispatch', None)
453454
)
454-
except: # This should only happen if the module is buggy
455+
except Exception as e: # This should only happen if the module is buggy
455456
# internal error, report as HTTP server error
456457
self.send_response(500)
458+
459+
# Send information about the exception if requested
460+
if hasattr(self.server, '_send_traceback_header') and \
461+
self.server._send_traceback_header:
462+
self.send_header("X-exception", str(e))
463+
self.send_header("X-traceback", traceback.format_exc())
464+
457465
self.end_headers()
458466
else:
459467
# got a valid XML RPC response
@@ -498,6 +506,12 @@ class SimpleXMLRPCServer(SocketServer.TCPServer,
498506

499507
allow_reuse_address = True
500508

509+
# Warning: this is for debugging purposes only! Never set this to True in
510+
# production code, as will be sending out sensitive information (exception
511+
# and stack trace details) when exceptions are raised inside
512+
# SimpleXMLRPCRequestHandler.do_POST
513+
_send_traceback_header = False
514+
501515
def __init__(self, addr, requestHandler=SimpleXMLRPCRequestHandler,
502516
logRequests=True, allow_none=False, encoding=None, bind_and_activate=True):
503517
self.logRequests = logRequests

Lib/test/cjkencodings_test.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,13 +376,20 @@
376376
b"\xcc\xc7\xce\x2c\x20\xb1\xd7\xb8\xae\xb0\xed\x20\xc0\xce\xc5\xcd"
377377
b"\xc7\xc1\xb8\xae\xc6\xc3\x0a\xc8\xaf\xb0\xe6\xc0\xba\x20\xc6\xc4"
378378
b"\xc0\xcc\xbd\xe3\xc0\xbb\x20\xbd\xba\xc5\xa9\xb8\xb3\xc6\xc3\xb0"
379-
b"\xfa\x20\xbf\xa9\xb7\xc1\x20\xba\xd0\xbe\xdf\xbf\xa1\xbc\xad\xbf"
379+
b"\xfa\x20\xbf\xa9\xb7\xaf\x20\xba\xd0\xbe\xdf\xbf\xa1\xbc\xad\xbf"
380380
b"\xcd\x20\xb4\xeb\xba\xce\xba\xd0\xc0\xc7\x20\xc7\xc3\xb7\xa7\xc6"
381381
b"\xfb\xbf\xa1\xbc\xad\xc0\xc7\x20\xba\xfc\xb8\xa5\x0a\xbe\xd6\xc7"
382382
b"\xc3\xb8\xae\xc4\xc9\xc0\xcc\xbc\xc7\x20\xb0\xb3\xb9\xdf\xc0\xbb"
383383
b"\x20\xc7\xd2\x20\xbc\xf6\x20\xc0\xd6\xb4\xc2\x20\xc0\xcc\xbb\xf3"
384384
b"\xc0\xfb\xc0\xce\x20\xbe\xf0\xbe\xee\xb7\xce\x20\xb8\xb8\xb5\xe9"
385-
b"\xbe\xee\xc1\xdd\xb4\xcf\xb4\xd9\x2e\x0a\x0a",
385+
b"\xbe\xee\xc1\xdd\xb4\xcf\xb4\xd9\x2e\x0a\x0a\xa1\xd9\xc3\xb9\xb0"
386+
b"\xa1\xb3\xa1\x3a\x20\xb3\xaf\xbe\xc6\xb6\xf3\x20\xa4\xd4\xa4\xb6"
387+
b"\xa4\xd0\xa4\xd4\xa4\xd4\xa4\xb6\xa4\xd0\xa4\xd4\xbe\xb1\x7e\x20"
388+
b"\xa4\xd4\xa4\xa4\xa4\xd2\xa4\xb7\xc5\xad\x21\x20\xa4\xd4\xa4\xa8"
389+
b"\xa4\xd1\xa4\xb7\xb1\xdd\xbe\xf8\xc0\xcc\x20\xc0\xfc\xa4\xd4\xa4"
390+
b"\xbe\xa4\xc8\xa4\xb2\xb4\xcf\xb4\xd9\x2e\x20\xa4\xd4\xa4\xb2\xa4"
391+
b"\xce\xa4\xaa\x2e\x20\xb1\xd7\xb7\xb1\xb0\xc5\x20\xa4\xd4\xa4\xb7"
392+
b"\xa4\xd1\xa4\xb4\xb4\xd9\x2e\x0a",
386393
b"\xe2\x97\x8e\x20\xed\x8c\x8c\xec\x9d\xb4\xec\x8d\xac\x28\x50\x79"
387394
b"\x74\x68\x6f\x6e\x29\xec\x9d\x80\x20\xeb\xb0\xb0\xec\x9a\xb0\xea"
388395
b"\xb8\xb0\x20\xec\x89\xbd\xea\xb3\xa0\x2c\x20\xea\xb0\x95\xeb\xa0"
@@ -404,7 +411,7 @@
404411
b"\xec\x9d\xb8\xed\x84\xb0\xed\x94\x84\xeb\xa6\xac\xed\x8c\x85\x0a"
405412
b"\xed\x99\x98\xea\xb2\xbd\xec\x9d\x80\x20\xed\x8c\x8c\xec\x9d\xb4"
406413
b"\xec\x8d\xac\xec\x9d\x84\x20\xec\x8a\xa4\xed\x81\xac\xeb\xa6\xbd"
407-
b"\xed\x8c\x85\xea\xb3\xbc\x20\xec\x97\xac\xeb\xa0\xa4\x20\xeb\xb6"
414+
b"\xed\x8c\x85\xea\xb3\xbc\x20\xec\x97\xac\xeb\x9f\xac\x20\xeb\xb6"
408415
b"\x84\xec\x95\xbc\xec\x97\x90\xec\x84\x9c\xec\x99\x80\x20\xeb\x8c"
409416
b"\x80\xeb\xb6\x80\xeb\xb6\x84\xec\x9d\x98\x20\xed\x94\x8c\xeb\x9e"
410417
b"\xab\xed\x8f\xbc\xec\x97\x90\xec\x84\x9c\xec\x9d\x98\x20\xeb\xb9"
@@ -413,7 +420,13 @@
413420
b"\x84\x20\xed\x95\xa0\x20\xec\x88\x98\x20\xec\x9e\x88\xeb\x8a\x94"
414421
b"\x20\xec\x9d\xb4\xec\x83\x81\xec\xa0\x81\xec\x9d\xb8\x20\xec\x96"
415422
b"\xb8\xec\x96\xb4\xeb\xa1\x9c\x20\xeb\xa7\x8c\xeb\x93\xa4\xec\x96"
416-
b"\xb4\xec\xa4\x8d\xeb\x8b\x88\xeb\x8b\xa4\x2e\x0a\x0a"),
423+
b"\xb4\xec\xa4\x8d\xeb\x8b\x88\xeb\x8b\xa4\x2e\x0a\x0a\xe2\x98\x86"
424+
b"\xec\xb2\xab\xea\xb0\x80\xeb\x81\x9d\x3a\x20\xeb\x82\xa0\xec\x95"
425+
b"\x84\xeb\x9d\xbc\x20\xec\x93\x94\xec\x93\x94\xec\x93\xa9\x7e\x20"
426+
b"\xeb\x8b\x81\xed\x81\xbc\x21\x20\xeb\x9c\xbd\xea\xb8\x88\xec\x97"
427+
b"\x86\xec\x9d\xb4\x20\xec\xa0\x84\xed\x99\xa5\xeb\x8b\x88\xeb\x8b"
428+
b"\xa4\x2e\x20\xeb\xb7\x81\x2e\x20\xea\xb7\xb8\xeb\x9f\xb0\xea\xb1"
429+
b"\xb0\x20\xec\x9d\x8e\xeb\x8b\xa4\x2e\x0a"),
417430
'gb18030': (
418431
b"\x50\x79\x74\x68\x6f\x6e\xa3\xa8\xc5\xc9\xc9\xad\xa3\xa9\xd3\xef"
419432
b"\xd1\xd4\xca\xc7\xd2\xbb\xd6\xd6\xb9\xa6\xc4\xdc\xc7\xbf\xb4\xf3"

Lib/test/test_codecencodings_kr.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,24 @@ class Test_EUCKR(test_multibytecodec_support.TestBase, unittest.TestCase):
3030
(b"abc\x80\x80\xc1\xc4", "replace", "abc\ufffd\uc894"),
3131
(b"abc\x80\x80\xc1\xc4\xc8", "replace", "abc\ufffd\uc894\ufffd"),
3232
(b"abc\x80\x80\xc1\xc4", "ignore", "abc\uc894"),
33+
34+
# composed make-up sequence errors
35+
(b"\xa4\xd4", "strict", None),
36+
(b"\xa4\xd4\xa4", "strict", None),
37+
(b"\xa4\xd4\xa4\xb6", "strict", None),
38+
(b"\xa4\xd4\xa4\xb6\xa4", "strict", None),
39+
(b"\xa4\xd4\xa4\xb6\xa4\xd0", "strict", None),
40+
(b"\xa4\xd4\xa4\xb6\xa4\xd0\xa4", "strict", None),
41+
(b"\xa4\xd4\xa4\xb6\xa4\xd0\xa4\xd4", "strict", "\uc4d4"),
42+
(b"\xa4\xd4\xa4\xb6\xa4\xd0\xa4\xd4x", "strict", "\uc4d4x"),
43+
(b"a\xa4\xd4\xa4\xb6\xa4", "replace", "a\ufffd"),
44+
(b"\xa4\xd4\xa3\xb6\xa4\xd0\xa4\xd4", "strict", None),
45+
(b"\xa4\xd4\xa4\xb6\xa3\xd0\xa4\xd4", "strict", None),
46+
(b"\xa4\xd4\xa4\xb6\xa4\xd0\xa3\xd4", "strict", None),
47+
(b"\xa4\xd4\xa4\xff\xa4\xd0\xa4\xd4", "replace", "\ufffd"),
48+
(b"\xa4\xd4\xa4\xb6\xa4\xff\xa4\xd4", "replace", "\ufffd"),
49+
(b"\xa4\xd4\xa4\xb6\xa4\xd0\xa4\xff", "replace", "\ufffd"),
50+
(b"\xc1\xc4", "strict", "\uc894"),
3351
)
3452

3553
class Test_JOHAB(test_multibytecodec_support.TestBase, unittest.TestCase):

Lib/test/test_codecmaps_kr.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ class TestEUCKRMap(test_multibytecodec_support.TestBase_Mapping,
2020
encoding = 'euc_kr'
2121
mapfileurl = 'http://people.freebsd.org/~perky/i18n/EUC-KR.TXT'
2222

23+
# A4D4 HANGUL FILLER indicates the begin of 8-bytes make-up sequence.
24+
pass_enctest = [(b'\xa4\xd4', '\u3164')]
25+
pass_dectest = [(b'\xa4\xd4', '\u3164')]
26+
2327

2428
class TestJOHABMap(test_multibytecodec_support.TestBase_Mapping,
2529
unittest.TestCase):

Lib/test/test_warnings.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import warnings
22
import os
3+
import sys
34
import unittest
45
from test import test_support
56

@@ -101,6 +102,10 @@ def test_main(verbose=None):
101102
# to test_main (regrtest -R).
102103
if '__warningregistry__' in globals():
103104
del globals()['__warningregistry__']
105+
if hasattr(warning_tests, '__warningregistry__'):
106+
del warning_tests.__warningregistry__
107+
if hasattr(sys, '__warningregistry__'):
108+
del sys.__warningregistry__
104109
test_support.run_unittest(TestModule)
105110

106111
if __name__ == "__main__":

Lib/test/test_xmlrpc.py

Lines changed: 91 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import xmlrpclib
77
import SimpleXMLRPCServer
88
import threading
9+
import mimetools
910
from test import test_support
1011

1112
alist = [{'astring': '[email protected]',
@@ -249,11 +250,9 @@ def div(self, x, y):
249250
'''This is the div function'''
250251
return x // y
251252

252-
253-
serv = SimpleXMLRPCServer.SimpleXMLRPCServer(("localhost", 0),
254-
logRequests=False, bind_and_activate=False)
255-
256253
try:
254+
serv = SimpleXMLRPCServer.SimpleXMLRPCServer(("localhost", 0),
255+
logRequests=False, bind_and_activate=False)
257256
serv.socket.settimeout(3)
258257
serv.server_bind()
259258
global PORT
@@ -278,11 +277,15 @@ def div(self, x, y):
278277
evt.set()
279278

280279

281-
class HTTPTestCase(unittest.TestCase):
280+
class SimpleServerTestCase(unittest.TestCase):
282281
def setUp(self):
282+
# enable traceback reporting
283+
SimpleXMLRPCServer.SimpleXMLRPCServer._send_traceback_header = True
284+
283285
self.evt = threading.Event()
284-
# start server thread to handle just one request
285-
threading.Thread(target=http_server, args=(self.evt,2)).start()
286+
# start server thread to handle requests
287+
serv_args = (self.evt, 2)
288+
threading.Thread(target=http_server, args=serv_args).start()
286289

287290
# wait for port to be assigned to server
288291
n = 1000
@@ -296,6 +299,9 @@ def tearDown(self):
296299
# wait on the server thread to terminate
297300
self.evt.wait()
298301

302+
# disable traceback reporting
303+
SimpleXMLRPCServer.SimpleXMLRPCServer._send_traceback_header = False
304+
299305
def test_simple1(self):
300306
p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
301307
self.assertEqual(p.pow(6,8), 6**8)
@@ -331,6 +337,82 @@ def test_multicall(self):
331337
self.assertEqual(div_result, 127//42)
332338

333339

340+
# This is a contrived way to make a failure occur on the server side
341+
# in order to test the _send_traceback_header flag on the server
342+
class FailingMessageClass(mimetools.Message):
343+
def __getitem__(self, key):
344+
key = key.lower()
345+
if key == 'content-length':
346+
return 'I am broken'
347+
return mimetools.Message.__getitem__(self, key)
348+
349+
350+
class FailingServerTestCase(unittest.TestCase):
351+
def setUp(self):
352+
self.evt = threading.Event()
353+
# start server thread to handle requests
354+
serv_args = (self.evt, 2)
355+
threading.Thread(target=http_server, args=serv_args).start()
356+
357+
# wait for port to be assigned to server
358+
n = 1000
359+
while n > 0 and PORT is None:
360+
time.sleep(0.001)
361+
n -= 1
362+
363+
time.sleep(0.5)
364+
365+
def tearDown(self):
366+
# wait on the server thread to terminate
367+
self.evt.wait()
368+
# reset flag
369+
SimpleXMLRPCServer.SimpleXMLRPCServer._send_traceback_header = False
370+
# reset message class
371+
SimpleXMLRPCServer.SimpleXMLRPCRequestHandler.MessageClass = mimetools.Message
372+
373+
def test_basic(self):
374+
# check that flag is false by default
375+
flagval = SimpleXMLRPCServer.SimpleXMLRPCServer._send_traceback_header
376+
self.assertEqual(flagval, False)
377+
378+
# test a call that won't fail just as a smoke test
379+
p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
380+
self.assertEqual(p.pow(6,8), 6**8)
381+
382+
def test_fail_no_info(self):
383+
# use the broken message class
384+
SimpleXMLRPCServer.SimpleXMLRPCRequestHandler.MessageClass = FailingMessageClass
385+
386+
try:
387+
p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
388+
p.pow(6,8)
389+
except xmlrpclib.ProtocolError as e:
390+
# The two server-side error headers shouldn't be sent back in this case
391+
self.assertTrue(e.headers.get("X-exception") is None)
392+
self.assertTrue(e.headers.get("X-traceback") is None)
393+
else:
394+
self.fail('ProtocolError not raised')
395+
396+
def test_fail_with_info(self):
397+
# use the broken message class
398+
SimpleXMLRPCServer.SimpleXMLRPCRequestHandler.MessageClass = FailingMessageClass
399+
400+
# Check that errors in the server send back exception/traceback
401+
# info when flag is set
402+
SimpleXMLRPCServer.SimpleXMLRPCServer._send_traceback_header = True
403+
404+
try:
405+
p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
406+
p.pow(6,8)
407+
except xmlrpclib.ProtocolError as e:
408+
# We should get error info in the response
409+
expected_err = "invalid literal for int() with base 10: 'I am broken'"
410+
self.assertEqual(e.headers.get("x-exception"), expected_err)
411+
self.assertTrue(e.headers.get("x-traceback") is not None)
412+
else:
413+
self.fail('ProtocolError not raised')
414+
415+
334416
def test_main():
335417
xmlrpc_tests = [XMLRPCTestCase, HelperTestCase, DateTimeTestCase,
336418
BinaryTestCase, FaultTestCase]
@@ -340,7 +422,8 @@ def test_main():
340422
# run on Windows. This only happens on the first test to run, but it
341423
# fails every time and so these tests are skipped on win32 platforms.
342424
if sys.platform != 'win32':
343-
xmlrpc_tests.append(HTTPTestCase)
425+
xmlrpc_tests.append(SimpleServerTestCase)
426+
xmlrpc_tests.append(FailingServerTestCase)
344427

345428
test_support.run_unittest(*xmlrpc_tests)
346429

Lib/threading.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,26 @@ def run(self):
445445
self.__target(*self.__args, **self.__kwargs)
446446

447447
def __bootstrap(self):
448+
# Wrapper around the real bootstrap code that ignores
449+
# exceptions during interpreter cleanup. Those typically
450+
# happen when a daemon thread wakes up at an unfortunate
451+
# moment, finds the world around it destroyed, and raises some
452+
# random exception *** while trying to report the exception in
453+
# __bootstrap_inner() below ***. Those random exceptions
454+
# don't help anybody, and they confuse users, so we suppress
455+
# them. We suppress them only when it appears that the world
456+
# indeed has already been destroyed, so that exceptions in
457+
# __bootstrap_inner() during normal business hours are properly
458+
# reported. Also, we only suppress them for daemonic threads;
459+
# if a non-daemonic encounters this, something else is wrong.
460+
try:
461+
self.__bootstrap_inner()
462+
except:
463+
if self.__daemonic and _sys is None:
464+
return
465+
raise
466+
467+
def __bootstrap_inner(self):
448468
try:
449469
self.__started = True
450470
_active_limbo_lock.acquire()

0 commit comments

Comments
 (0)