Skip to content

Commit e32fe73

Browse files
AmanSal1jacobtylerwallsPierre-Sassoulas
authored
Add deprecated-attribute message and upgrade data for 3.12 (#8857)
* Update deprecated-x examples * Add further 3.12 deprecations --------- Co-authored-by: Jacob Walls <[email protected]> Co-authored-by: Pierre Sassoulas <[email protected]>
1 parent 2289c71 commit e32fe73

File tree

20 files changed

+155
-14
lines changed

20 files changed

+155
-14
lines changed
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,2 @@
1-
This message can be raised on your own code using a `custom deprecation checker`_ (follow link for a full example).
2-
3-
Loading this custom checker using ``load-plugins`` would start raising ``deprecated-argument``.
4-
5-
The actual replacement then need to be studied on a case by case basis by reading the
6-
deprecation warning or the release notes.
7-
8-
.. _`custom deprecation checker`: https://github.com/pylint-dev/pylint/blob/main/examples/deprecation_checker.py
1+
The actual replacement needs to be studied on a case by case basis
2+
by reading the deprecation warning or the release notes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from configparser import ParsingError
2+
3+
err = ParsingError("filename")
4+
source = err.filename # [deprecated-attribute]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The actual replacement needs to be studied on a case by case basis
2+
by reading the deprecation warning or the release notes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from configparser import ParsingError
2+
3+
err = ParsingError("filename")
4+
source = err.source
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
The actual replacement need to be studied on a case by case basis
1+
The actual replacement needs to be studied on a case by case basis
22
by reading the deprecation warning or the release notes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
The actual replacement need to be studied on a case by case basis
1+
The actual replacement needs to be studied on a case by case basis
22
by reading the deprecation warning or the release notes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
The actual replacement need to be studied on a case by case basis
1+
The actual replacement needs to be studied on a case by case basis
22
by reading the deprecation warning or the release notes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
The actual replacement need to be studied on a case by case basis
1+
The actual replacement needs to be studied on a case by case basis
22
by reading the deprecation warning or the release notes.

doc/user_guide/checkers/features.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,8 @@ Stdlib checker Messages
10441044
emitted when using Python >= 3.5.
10451045
:deprecated-argument (W4903): *Using deprecated argument %s of method %s()*
10461046
The argument is marked as deprecated and will be removed in the future.
1047+
:deprecated-attribute (W4906): *Using deprecated attribute %r*
1048+
The attribute is marked as deprecated and will be removed in the future.
10471049
:deprecated-class (W4904): *Using deprecated class %s of module %s*
10481050
The class is marked as deprecated and will be removed in the future.
10491051
:deprecated-decorator (W4905): *Using deprecated decorator %s()*

doc/user_guide/messages/messages_overview.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ All messages in the warning category:
229229
warning/consider-ternary-expression
230230
warning/dangerous-default-value
231231
warning/deprecated-argument
232+
warning/deprecated-attribute
232233
warning/deprecated-class
233234
warning/deprecated-decorator
234235
warning/deprecated-method

0 commit comments

Comments
 (0)