mirror of
https://github.com/python/cpython.git
synced 2025-10-21 22:22:48 +00:00
gh-114091: Reword error message for unawaitable types (#114090)
Reword error message for unawaitable types.
This commit is contained in:
parent
a26d27e7ee
commit
2c7209a3bd
5 changed files with 10 additions and 9 deletions
|
@ -974,13 +974,13 @@ class CoroutineTest(unittest.TestCase):
|
|||
|
||||
async def foo():
|
||||
await 1
|
||||
with self.assertRaisesRegex(TypeError, "object int can.t.*await"):
|
||||
with self.assertRaisesRegex(TypeError, "'int' object can.t be awaited"):
|
||||
run_async(foo())
|
||||
|
||||
def test_await_2(self):
|
||||
async def foo():
|
||||
await []
|
||||
with self.assertRaisesRegex(TypeError, "object list can.t.*await"):
|
||||
with self.assertRaisesRegex(TypeError, "'list' object can.t be awaited"):
|
||||
run_async(foo())
|
||||
|
||||
def test_await_3(self):
|
||||
|
@ -1040,7 +1040,7 @@ class CoroutineTest(unittest.TestCase):
|
|||
async def foo(): return await Awaitable()
|
||||
|
||||
with self.assertRaisesRegex(
|
||||
TypeError, "object Awaitable can't be used in 'await' expression"):
|
||||
TypeError, "'Awaitable' object can't be awaited"):
|
||||
|
||||
run_async(foo())
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue