Skip to content

Commit e6e6c0f

Browse files
eurestimsullivan
authored andcommitted
[attrs] Remove error message about deprecated cmp (#7675)
1 parent 4510a0b commit e6e6c0f

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

mypy/plugins/attrs.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ def _determine_eq_order(ctx: 'mypy.plugin.ClassDefContext') -> Tuple[bool, bool]
190190

191191
# cmp takes precedence due to bw-compatibility.
192192
if cmp is not None:
193-
ctx.api.fail("cmp is deprecated, use eq and order", ctx.reason)
194193
return cmp, cmp
195194

196195
# If left None, equality is on and ordering mirrors equality.

test-data/unit/check-attr.test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,15 +278,15 @@ A(1) != 1
278278

279279
[case testAttrsCmpEqOrderValues]
280280
from attr import attrib, attrs
281-
@attrs(cmp=True) # E: cmp is deprecated, use eq and order
281+
@attrs(cmp=True)
282282
class DeprecatedTrue:
283283
...
284284

285-
@attrs(cmp=False) # E: cmp is deprecated, use eq and order
285+
@attrs(cmp=False)
286286
class DeprecatedFalse:
287287
...
288288

289-
@attrs(cmp=False, eq=True) # E: Don't mix `cmp` with `eq' and `order` # E: cmp is deprecated, use eq and order
289+
@attrs(cmp=False, eq=True) # E: Don't mix `cmp` with `eq' and `order`
290290
class Mixed:
291291
...
292292

0 commit comments

Comments
 (0)