mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-104773: PEP 594: Remove the nntplib module (#104894)
* socket_helper.transient_internet() no longer imports nntplib to catch nntplib.NNTPTemporaryError. * ssltests.py no longer runs test_nntplib. * "make quicktest" no longer runs test_nntplib. * WASM: remove nntplib from OMIT_NETWORKING_FILES. * Remove mentions to nntplib in the email documentation.
This commit is contained in:
parent
684e99d01d
commit
ded5f1f287
26 changed files with 33 additions and 3364 deletions
|
@ -7,7 +7,6 @@ import tempfile
|
|||
import unittest
|
||||
|
||||
from .. import support
|
||||
from . import warnings_helper
|
||||
|
||||
HOST = "localhost"
|
||||
HOSTv4 = "127.0.0.1"
|
||||
|
@ -195,7 +194,6 @@ _NOT_SET = object()
|
|||
def transient_internet(resource_name, *, timeout=_NOT_SET, errnos=()):
|
||||
"""Return a context manager that raises ResourceDenied when various issues
|
||||
with the internet connection manifest themselves as exceptions."""
|
||||
nntplib = warnings_helper.import_deprecated("nntplib")
|
||||
import urllib.error
|
||||
if timeout is _NOT_SET:
|
||||
timeout = support.INTERNET_TIMEOUT
|
||||
|
@ -248,10 +246,6 @@ def transient_internet(resource_name, *, timeout=_NOT_SET, errnos=()):
|
|||
if timeout is not None:
|
||||
socket.setdefaulttimeout(timeout)
|
||||
yield
|
||||
except nntplib.NNTPTemporaryError as err:
|
||||
if support.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