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