]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-32591: _PyErr_WarnUnawaitedCoroutine() sets source (GH-19247)
authorVictor Stinner <vstinner@python.org>
Tue, 31 Mar 2020 15:25:12 +0000 (17:25 +0200)
committerGitHub <noreply@github.com>
Tue, 31 Mar 2020 15:25:12 +0000 (17:25 +0200)
commit8d84adcd736619c2ce510dff1e7ffd3ab08df06a
treed95ccebcf82fbe67588887372e1718c3819f0cd7
parent5be8241392453751beea21d2e32096c15a8d47db
bpo-32591: _PyErr_WarnUnawaitedCoroutine() sets source (GH-19247)

The _PyErr_WarnUnawaitedCoroutine() fallback now also sets the
coroutine object as the source of the warning, as done by the Python
implementation warnings._warn_unawaited_coroutine().

Moreover, don't truncate the coroutine name: Python supports
arbitrary string length to format the message.
Python/_warnings.c