diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2020-04-25 07:04:10 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-25 07:04:10 (GMT) |
| commit | 3c8a5b459d68b4337776ada1e04f5b33f90a2275 (patch) | |
| tree | f86166f552b0e9ff210dc81350b9b41178815b5d /Lib/test | |
| parent | d4f3923d5901ef1ccdbe6ad6c5a753af90832a0f (diff) | |
| download | cpython-3c8a5b459d68b4337776ada1e04f5b33f90a2275.zip cpython-3c8a5b459d68b4337776ada1e04f5b33f90a2275.tar.gz cpython-3c8a5b459d68b4337776ada1e04f5b33f90a2275.tar.bz2 | |
bpo-40275: Avoid importing asyncio in test.support (GH-19600)
* Import asyncio lazily in unittest (only when IsolatedAsyncioTestCase is used).
* Import asyncio.events lazily in test.support.
Diffstat (limited to 'Lib/test')
| -rw-r--r-- | Lib/test/support/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index f3868c1..2b3a414 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -3,7 +3,6 @@ if __name__ != 'test.support': raise ImportError('support must be imported from the test package') -import asyncio.events import collections.abc import contextlib import errno @@ -3260,6 +3259,7 @@ SMALLEST = _SMALLEST() def maybe_get_event_loop_policy(): """Return the global event loop policy if one is set, else return None.""" + import asyncio.events return asyncio.events._event_loop_policy # Helpers for testing hashing. |
