Skip to content

Commit ed6d7d1

Browse files
authored
Don't report error when using total_ordering in Python 2 mode (#10416)
Even if the plugin doesn't work yet, generating an error is a regression. The decorator used to silently do nothing in earlier mypy versions. Not having the plugin doesn't complelety prevent type checking code using `total_ordering`.
1 parent 0729345 commit ed6d7d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mypy/plugins/functools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def functools_total_ordering_maker_callback(ctx: mypy.plugin.ClassDefContext,
2626
auto_attribs_default: bool = False) -> None:
2727
"""Add dunder methods to classes decorated with functools.total_ordering."""
2828
if ctx.api.options.python_version < (3,):
29-
ctx.api.fail('"functools.total_ordering" is not supported in Python 2', ctx.reason)
29+
# This plugin is not supported in Python 2 mode (it's a no-op).
3030
return
3131

3232
comparison_methods = _analyze_class(ctx)

0 commit comments

Comments
 (0)