summaryrefslogtreecommitdiffstats
path: root/Lib/distutils
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-05-11 23:18:23 (GMT)
committerGitHub <noreply@github.com>2021-05-11 23:18:23 (GMT)
commit7d38b04b610b36af0fdcf82fba15b52c7ce44911 (patch)
treec7e7ffaf9baea70bf38b37589ac5fd8d73b141d8 /Lib/distutils
parent37a9d43dd2a7f2b73f60c43a94a1229d6de5d674 (diff)
downloadcpython-7d38b04b610b36af0fdcf82fba15b52c7ce44911.zip
cpython-7d38b04b610b36af0fdcf82fba15b52c7ce44911.tar.gz
cpython-7d38b04b610b36af0fdcf82fba15b52c7ce44911.tar.bz2
Fix import of HTTPError (GH-22304) (GH-26048)
Import HTTPError from urllib.error instead of urllib.request. (cherry picked from commit 5fedf71439187f00c661b16b80d398b74b00390e) Co-authored-by: Sebastian Rittau <srittau@rittau.biz> Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Diffstat (limited to 'Lib/distutils')
-rw-r--r--Lib/distutils/command/upload.py3
-rw-r--r--Lib/distutils/tests/test_upload.py2
2 files changed, 3 insertions, 2 deletions
diff --git a/Lib/distutils/command/upload.py b/Lib/distutils/command/upload.py
index 95e9fda..e0ecb65 100644
--- a/Lib/distutils/command/upload.py
+++ b/Lib/distutils/command/upload.py
@@ -9,7 +9,8 @@ import os
import io
import hashlib
from base64 import standard_b64encode
-from urllib.request import urlopen, Request, HTTPError
+from urllib.error import HTTPError
+from urllib.request import urlopen, Request
from urllib.parse import urlparse
from distutils.errors import DistutilsError, DistutilsOptionError
from distutils.core import PyPIRCCommand
diff --git a/Lib/distutils/tests/test_upload.py b/Lib/distutils/tests/test_upload.py
index bca5516..74f0bc0 100644
--- a/Lib/distutils/tests/test_upload.py
+++ b/Lib/distutils/tests/test_upload.py
@@ -2,7 +2,7 @@
import os
import unittest
import unittest.mock as mock
-from urllib.request import HTTPError
+from urllib.error import HTTPError
from test.support import run_unittest