diff options
author | Zackery Spytz <zspytz@gmail.com> | 2018-12-17 14:52:45 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2018-12-17 14:52:45 (GMT) |
commit | 842acaab1376c5c84fd5966bb6070e289880e1ca (patch) | |
tree | f21283245b7e349d05482b89fde8d570b33c53ab /Lib/test/test_asyncio | |
parent | 4db62e115891425db2a974142a72d8eaaf95eecb (diff) | |
download | cpython-842acaab1376c5c84fd5966bb6070e289880e1ca.zip cpython-842acaab1376c5c84fd5966bb6070e289880e1ca.tar.gz cpython-842acaab1376c5c84fd5966bb6070e289880e1ca.tar.bz2 |
bpo-35504: Fix segfaults and SystemErrors when deleting certain attrs. (GH-11175)
Diffstat (limited to 'Lib/test/test_asyncio')
-rw-r--r-- | Lib/test/test_asyncio/test_futures.py | 7 | ||||
-rw-r--r-- | Lib/test/test_asyncio/test_tasks.py | 9 |
2 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_futures.py b/Lib/test/test_asyncio/test_futures.py index 3339356..2e4583d 100644 --- a/Lib/test/test_asyncio/test_futures.py +++ b/Lib/test/test_asyncio/test_futures.py @@ -570,6 +570,13 @@ class CFutureTests(BaseFutureTests, test_utils.TestCase): except AttributeError: cls = None + def test_future_del_segfault(self): + fut = self._new_future(loop=self.loop) + with self.assertRaises(AttributeError): + del fut._asyncio_future_blocking + with self.assertRaises(AttributeError): + del fut._log_traceback + @unittest.skipUnless(hasattr(futures, '_CFuture'), 'requires the C _asyncio module') diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py index c65d1f2..22f14f8 100644 --- a/Lib/test/test_asyncio/test_tasks.py +++ b/Lib/test/test_asyncio/test_tasks.py @@ -2546,6 +2546,15 @@ class CTask_CFuture_Tests(BaseTaskTests, SetMethodsTest, self.loop.run_until_complete(task) self.assertAlmostEqual(gettotalrefcount() - refs_before, 0, delta=10) + def test_del__log_destroy_pending_segfault(self): + @asyncio.coroutine + def coro(): + pass + task = self.new_task(self.loop, coro()) + self.loop.run_until_complete(task) + with self.assertRaises(AttributeError): + del task._log_destroy_pending + @unittest.skipUnless(hasattr(futures, '_CFuture') and hasattr(tasks, '_CTask'), |