mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
Issue #20980: Stop wrapping exception when using ThreadPool.
This commit is contained in:
parent
a40675a1a2
commit
80a5be1d84
4 changed files with 30 additions and 6 deletions
|
@ -1810,6 +1810,17 @@ class _TestPool(BaseTestCase):
|
|||
self.assertIn('raise RuntimeError(123) # some comment',
|
||||
f1.getvalue())
|
||||
|
||||
@classmethod
|
||||
def _test_wrapped_exception(cls):
|
||||
raise RuntimeError('foo')
|
||||
|
||||
def test_wrapped_exception(self):
|
||||
# Issue #20980: Should not wrap exception when using thread pool
|
||||
with self.Pool(1) as p:
|
||||
with self.assertRaises(RuntimeError):
|
||||
p.apply(self._test_wrapped_exception)
|
||||
|
||||
|
||||
def raising():
|
||||
raise KeyError("key")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue