[Python-checkins] gh-105407: Remove unused imports (#105554)

vstinner webhook-mailer at python.org
Fri Jun 9 08:50:39 EDT 2023


https://github.com/python/cpython/commit/0f885ffa94aa9b69ff556e119cb17deb23a5a4b3
commit: 0f885ffa94aa9b69ff556e119cb17deb23a5a4b3
branch: main
author: Victor Stinner <vstinner at python.org>
committer: vstinner <vstinner at python.org>
date: 2023-06-09T12:50:31Z
summary:

gh-105407: Remove unused imports (#105554)

files:
M Lib/test/test___all__.py
M Lib/test/test_capi/test_unicode.py
M Lib/test/test_urllib2_localnet.py
M Lib/webbrowser.py
M Misc/python-config.in

diff --git a/Lib/test/test___all__.py b/Lib/test/test___all__.py
index 6b0e2b020d0b..2163f1636566 100644
--- a/Lib/test/test___all__.py
+++ b/Lib/test/test___all__.py
@@ -101,7 +101,8 @@ def test_all(self):
         ])
 
         # In case _socket fails to build, make this test fail more gracefully
-        # than an AttributeError somewhere deep in CGIHTTPServer.
+        # than an AttributeError somewhere deep in concurrent.futures, email
+        # or unittest.
         import _socket
 
         ignored = []
diff --git a/Lib/test/test_capi/test_unicode.py b/Lib/test/test_capi/test_unicode.py
index 9c7662065689..ca914459a62b 100644
--- a/Lib/test/test_capi/test_unicode.py
+++ b/Lib/test/test_capi/test_unicode.py
@@ -329,7 +329,7 @@ def test_from_format(self):
             pythonapi, py_object, sizeof,
             c_int, c_long, c_longlong, c_ssize_t,
             c_uint, c_ulong, c_ulonglong, c_size_t, c_void_p,
-            sizeof, c_wchar, c_wchar_p)
+            c_wchar, c_wchar_p)
         name = "PyUnicode_FromFormat"
         _PyUnicode_FromFormat = getattr(pythonapi, name)
         _PyUnicode_FromFormat.argtypes = (c_char_p,)
diff --git a/Lib/test/test_urllib2_localnet.py b/Lib/test/test_urllib2_localnet.py
index 1c5b027931c1..0dcdbac76b50 100644
--- a/Lib/test/test_urllib2_localnet.py
+++ b/Lib/test/test_urllib2_localnet.py
@@ -11,7 +11,6 @@
 from test import support
 from test.support import hashlib_helper
 from test.support import threading_helper
-from test.support import warnings_helper
 
 try:
     import ssl
diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py
index 01a82fb8857c..4fc9470051c1 100755
--- a/Lib/webbrowser.py
+++ b/Lib/webbrowser.py
@@ -8,7 +8,6 @@
 import sys
 import subprocess
 import threading
-import warnings
 
 __all__ = ["Error", "open", "open_new", "open_new_tab", "get", "register"]
 
diff --git a/Misc/python-config.in b/Misc/python-config.in
index ebd99daa0c27..81c3316e334a 100644
--- a/Misc/python-config.in
+++ b/Misc/python-config.in
@@ -4,7 +4,6 @@
 # Keep this script in sync with python-config.sh.in
 
 import getopt
-import os
 import sys
 import sysconfig
 



More information about the Python-checkins mailing list