diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2020-09-03 20:54:06 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-03 20:54:06 (GMT) |
commit | 1f5f12737755f246fee83a54c600779ad76934a4 (patch) | |
tree | 10a749ecd98b3b730ec31af1b48107f511187011 /Lib/asyncio | |
parent | a986b061a3cd4661eb9f857e2936291f1847bd15 (diff) | |
download | cpython-1f5f12737755f246fee83a54c600779ad76934a4.zip cpython-1f5f12737755f246fee83a54c600779ad76934a4.tar.gz cpython-1f5f12737755f246fee83a54c600779ad76934a4.tar.bz2 |
bpo-41696: Fix handling of debug mode in asyncio.run (GH-22069) (#22072)
* bpo-41696: Fix handling of debug mode in asyncio.run
This allows PYTHONASYNCIODEBUG or -X dev to enable asyncio debug mode
when using asyncio.run
* 📜🤖 Added by blurb_it.
Co-authored-by: hauntsaninja <>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 0770ad948cb6d9f7f6c4002efd83e27c27069808)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Diffstat (limited to 'Lib/asyncio')
-rw-r--r-- | Lib/asyncio/runners.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/asyncio/runners.py b/Lib/asyncio/runners.py index 2e37e18..d2fa8b7 100644 --- a/Lib/asyncio/runners.py +++ b/Lib/asyncio/runners.py @@ -5,7 +5,7 @@ from . import events from . import tasks -def run(main, *, debug=False): +def run(main, *, debug=None): """Execute the coroutine and return the result. This function runs the passed coroutine, taking care of @@ -39,7 +39,8 @@ def run(main, *, debug=False): loop = events.new_event_loop() try: events.set_event_loop(loop) - loop.set_debug(debug) + if debug is not None: + loop.set_debug(debug) return loop.run_until_complete(main) finally: try: |