Skip to content

Commit 5fedf71

Browse files
authored
Fix import of HTTPError (pythonGH-22304)
Import HTTPError from urllib.error instead of urllib.request.
1 parent 23ae2c3 commit 5fedf71

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Lib/distutils/command/upload.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
import io
1010
import hashlib
1111
from base64 import standard_b64encode
12-
from urllib.request import urlopen, Request, HTTPError
12+
from urllib.error import HTTPError
13+
from urllib.request import urlopen, Request
1314
from urllib.parse import urlparse
1415
from distutils.errors import DistutilsError, DistutilsOptionError
1516
from distutils.core import PyPIRCCommand

Lib/distutils/tests/test_upload.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33
import unittest
44
import unittest.mock as mock
5-
from urllib.request import HTTPError
5+
from urllib.error import HTTPError
66

77
from test.support import run_unittest
88

0 commit comments

Comments
 (0)