Skip to content

Commit e8ed3a8

Browse files
committed
Ensure PDB cleans up event loop policies after using asyncio.
1 parent a936af9 commit e8ed3a8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Lib/test/test_pdb.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import zipapp
1414
import zipfile
1515

16+
from asyncio.events import _set_event_loop_policy
1617
from contextlib import ExitStack, redirect_stdout
1718
from io import StringIO
1819
from test import support
@@ -41,6 +42,10 @@ def __exit__(self, *exc):
4142
if self.orig_trace:
4243
sys.settrace(self.orig_trace)
4344

45+
# To prevent a warning "test altered the execution environment" if
46+
# asyncio features are used.
47+
_set_event_loop_policy(None)
48+
4449

4550
def test_pdb_displayhook():
4651
"""This tests the custom displayhook for pdb.

0 commit comments

Comments
 (0)