diff --git a/Lib/test/test_asyncio/utils.py b/Lib/test/test_asyncio/utils.py index 0ff79cfbd4d78a..3fe2ecd2be6d0c 100644 --- a/Lib/test/test_asyncio/utils.py +++ b/Lib/test/test_asyncio/utils.py @@ -550,10 +550,8 @@ def close_loop(loop): policy = support.maybe_get_event_loop_policy() if policy is not None: try: - with warnings.catch_warnings(): - warnings.simplefilter('ignore', DeprecationWarning) - watcher = policy._watcher - except NotImplementedError: + watcher = policy._watcher + except AttributeError: # watcher is not implemented by EventLoopPolicy, e.g. Windows pass else: