Skip to content
Snippets Groups Projects
Unverified Commit 1fce240d authored by Victor Stinner's avatar Victor Stinner Committed by GitHub
Browse files

bpo-41939: Fix test_site.test_license_exists_at_url() (#22559)

Call urllib.request.urlcleanup() to reset the global
urllib.request._opener.
parent 060937da
No related branches found
No related tags found
No related merge requests found
......@@ -525,6 +525,8 @@ def test_license_exists_at_url(self):
# string displayed by license in the absence of a LICENSE file.
url = license._Printer__data.split()[1]
req = urllib.request.Request(url, method='HEAD')
# Reset global urllib.request._opener
self.addCleanup(urllib.request.urlcleanup)
try:
with socket_helper.transient_internet(url):
with urllib.request.urlopen(req) as data:
......
Fix test_site.test_license_exists_at_url(): call
``urllib.request.urlcleanup()`` to reset the global
``urllib.request._opener``. Patch by Victor Stinner.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment