Skip to content

Commit 47e3562

Browse files
authored
gh-84623: Remove unused imports (#94132)
1 parent 8661c50 commit 47e3562

28 files changed

+9
-43
lines changed

Doc/includes/email-headers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Import the email modules we'll need
2-
from email.parser import BytesParser, Parser
2+
#from email.parser import BytesParser
3+
from email.parser import Parser
34
from email.policy import default
45

56
# If the e-mail headers are in a file, uncomment these two lines:

Doc/tools/extensions/asdl_highlight.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import os
21
import sys
32
from pathlib import Path
43

54
CPYTHON_ROOT = Path(__file__).resolve().parent.parent.parent.parent
65
sys.path.append(str(CPYTHON_ROOT / "Parser"))
76

87
from pygments.lexer import RegexLexer, bygroups, include, words
9-
from pygments.token import (Comment, Generic, Keyword, Name, Operator,
8+
from pygments.token import (Comment, Keyword, Name, Operator,
109
Punctuation, Text)
1110

1211
from asdl import builtin_types

Doc/tools/extensions/peg_highlight.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from pygments.lexer import RegexLexer, bygroups, include
2-
from pygments.token import Comment, Generic, Keyword, Name, Operator, Punctuation, Text
2+
from pygments.token import Comment, Keyword, Name, Operator, Punctuation, Text
33

44
from sphinx.highlighting import lexers
55

Doc/tools/extensions/pyspecific.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
from sphinx.util import status_iterator, logging
3131
from sphinx.util.nodes import split_explicit_title
3232
from sphinx.writers.text import TextWriter, TextTranslator
33-
from sphinx.writers.latex import LaTeXTranslator
3433

3534
try:
3635
from sphinx.domains.python import PyFunction, PyMethod

Lib/random.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
from math import sqrt as _sqrt, acos as _acos, cos as _cos, sin as _sin
5151
from math import tau as TWOPI, floor as _floor, isfinite as _isfinite
5252
from os import urandom as _urandom
53-
from _collections_abc import Set as _Set, Sequence as _Sequence
53+
from _collections_abc import Sequence as _Sequence
5454
from operator import index as _index
5555
from itertools import accumulate as _accumulate, repeat as _repeat
5656
from bisect import bisect as _bisect

Lib/test/test_asyncio/test_unix_events.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import socket
1010
import stat
1111
import sys
12-
import tempfile
1312
import threading
1413
import unittest
1514
from unittest import mock

Lib/test/test_ctypes/test_parameters.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
class SimpleTypesTestCase(unittest.TestCase):
66

77
def setUp(self):
8-
import ctypes
98
try:
109
from _ctypes import set_conversion_mode
1110
except ImportError:

Lib/test/test_sqlite3/test_transactions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# misrepresented as being the original software.
2121
# 3. This notice may not be removed or altered from any source distribution.
2222

23-
import os, unittest
23+
import unittest
2424
import sqlite3 as sqlite
2525

2626
from test.support import LOOPBACK_TIMEOUT

Lib/test/test_unittest/test_program.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import io
2-
31
import os
42
import sys
53
import subprocess

Lib/test/test_unittest/test_result.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import sys
33
import textwrap
44

5-
from test.support import warnings_helper, captured_stdout, captured_stderr
5+
from test.support import warnings_helper, captured_stdout
66

77
import traceback
88
import unittest

0 commit comments

Comments
 (0)