Skip to content

Commit b1bb7f8

Browse files
Add distutils to deprecated modules (#5864)
1 parent 6c0ba13 commit b1bb7f8

File tree

7 files changed

+19
-1
lines changed

7 files changed

+19
-1
lines changed

ChangeLog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,8 @@ Release date: TBA
405405

406406
Closes #5862
407407

408+
* Importing the deprecated stdlib module ``distutils`` now emits ``deprecated_module`` on Python 3.10+.
409+
408410
* ``missing-raises-doc`` will now check the class hierarchy of the raised exceptions
409411

410412
.. code-block:: python

doc/whatsnew/2.13.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,8 @@ Other Changes
392392

393393
Closes #5862
394394

395+
* Importing the deprecated stdlib module ``distutils`` now emits ``deprecated_module`` on Python 3.10+.
396+
395397
* Fixed false positive ``unexpected-keyword-arg`` for decorators.
396398

397399
Closes #258

pylint/checkers/stdlib.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
(3, 6, 0): {"asynchat", "asyncore"},
8080
(3, 7, 0): {"macpath"},
8181
(3, 9, 0): {"lib2to3", "parser", "symbol", "binhex"},
82+
(3, 10, 0): {"distutils"},
8283
}
8384

8485
DEPRECATED_ARGUMENTS = {
@@ -126,6 +127,7 @@
126127
"abc.abstractstaticmethod",
127128
"abc.abstractproperty",
128129
},
130+
(3, 4, 0): {"importlib.util.module_for_loader"},
129131
}
130132

131133

@@ -205,6 +207,10 @@
205207
},
206208
(3, 4, 0): {
207209
"importlib.find_loader",
210+
"importlib.abc.Loader.load_module",
211+
"importlib.abc.Loader.module_repr",
212+
"importlib.abc.PathEntryFinder.find_loader",
213+
"importlib.abc.PathEntryFinder.find_module",
208214
"plistlib.readPlist",
209215
"plistlib.writePlist",
210216
"plistlib.readPlistFromBytes",
@@ -253,6 +259,7 @@
253259
},
254260
(3, 10, 0): {
255261
"_sqlite3.enable_shared_cache",
262+
"importlib.abc.Finder.find_module",
256263
"pathlib.Path.link_to",
257264
"zipimport.zipimporter.load_module",
258265
"zipimport.zipimporter.find_module",
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"""Test deprecated modules from Python 3.10."""
2+
# pylint: disable=unused-import
3+
4+
import distutils # [deprecated-module]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[testoptions]
2+
min_pyver = 3.10
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
deprecated-module:4:0:4:16::Uses of a deprecated module 'distutils':UNDEFINED

tests/functional/r/regression_02/regression_distutil_import_error_73.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
https://github.com/PyCQA/astroid/pull/1321
88
"""
99

10-
# pylint: disable=unused-import
10+
# pylint: disable=unused-import, deprecated-module
1111

1212
import distutils.version
1313
from distutils.util import strtobool

0 commit comments

Comments
 (0)