summaryrefslogtreecommitdiff
path: root/pylint/checkers/refactoring
diff options
context:
space:
mode:
authorGideon <87426140+GideonBear@users.noreply.github.com>2022-12-21 20:38:26 +0100
committerGitHub <noreply@github.com>2022-12-21 20:38:26 +0100
commit2ae0e98454c28e2aaf1c892655f34eb8d19772d7 (patch)
tree37e1c5fa92343ed4d847b8fe96fc6ec2d59dccf5 /pylint/checkers/refactoring
parent71baf6a62617ee62aadc7513aae63c829cb8fda5 (diff)
downloadpylint-git-2ae0e98454c28e2aaf1c892655f34eb8d19772d7.tar.gz
``consider-using-with`` now triggers for ``pathlib.Path.open`` (#7968)
Diffstat (limited to 'pylint/checkers/refactoring')
-rw-r--r--pylint/checkers/refactoring/refactoring_checker.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/pylint/checkers/refactoring/refactoring_checker.py b/pylint/checkers/refactoring/refactoring_checker.py
index 361238592..4735c9e17 100644
--- a/pylint/checkers/refactoring/refactoring_checker.py
+++ b/pylint/checkers/refactoring/refactoring_checker.py
@@ -49,6 +49,7 @@ CALLS_THAT_COULD_BE_REPLACED_BY_WITH = frozenset(
CALLS_RETURNING_CONTEXT_MANAGERS = frozenset(
(
"_io.open", # regular 'open()' call
+ "pathlib.Path.open",
"codecs.open",
"urllib.request.urlopen",
"tempfile.NamedTemporaryFile",