mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Skip nntplib tests when transient errors captured.
This commit is contained in:
commit
d09620839c
1 changed files with 5 additions and 0 deletions
|
@ -13,6 +13,7 @@ import gc
|
|||
import importlib
|
||||
import importlib.util
|
||||
import logging.handlers
|
||||
import nntplib
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
|
@ -1341,6 +1342,10 @@ def transient_internet(resource_name, *, timeout=30.0, errnos=()):
|
|||
if timeout is not None:
|
||||
socket.setdefaulttimeout(timeout)
|
||||
yield
|
||||
except nntplib.NNTPTemporaryError as err:
|
||||
if verbose:
|
||||
sys.stderr.write(denied.args[0] + "\n")
|
||||
raise denied from err
|
||||
except OSError as err:
|
||||
# urllib can wrap original socket errors multiple times (!), we must
|
||||
# unwrap to get at the original error.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue