summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Mueller <30130371+cdce8p@users.noreply.github.com>2021-04-23 20:29:52 +0200
committerGitHub <noreply@github.com>2021-04-23 20:29:52 +0200
commit81c7c50ad0273e2027f636edbddba9d410c8319a (patch)
tree29a8f6fda0499e8df2895c76050fba46f65afed6
parent95c05e024cf4d74fa25ee1a8cbcc5e08ebc1407f (diff)
downloadpylint-git-81c7c50ad0273e2027f636edbddba9d410c8319a.tar.gz
Don't auto-enable postponed evaluation of type annotations with PY310 (#4385)
-rw-r--r--ChangeLog2
-rw-r--r--pylint/checkers/utils.py5
2 files changed, 2 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index ffbaec574..3a2759a98 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -43,6 +43,8 @@ Release date: Undefined
Closes #3406
+* Don't auto-enable postponed evaluation of type annotations with Python 3.10
+
What's New in Pylint 2.7.5?
===========================
diff --git a/pylint/checkers/utils.py b/pylint/checkers/utils.py
index edbc4b489..86a65c6da 100644
--- a/pylint/checkers/utils.py
+++ b/pylint/checkers/utils.py
@@ -70,8 +70,6 @@ from typing import (
import _string
import astroid
-from pylint.constants import PY310_PLUS
-
BUILTINS_NAME = builtins.__name__
COMP_NODE_TYPES = (
astroid.ListComp,
@@ -1328,9 +1326,6 @@ def get_node_last_lineno(node: astroid.node_classes.NodeNG) -> int:
def is_postponed_evaluation_enabled(node: astroid.node_classes.NodeNG) -> bool:
"""Check if the postponed evaluation of annotations is enabled"""
- if PY310_PLUS:
- return True
-
module = node.root()
return "annotations" in module.future_imports