Skip to content

Commit

Permalink
[PY313] Pathlib.Path infers as BoundMethod now
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtylerwalls committed Aug 6, 2024
1 parent ae2e789 commit b98e649
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pylint/checkers/refactoring/refactoring_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
(
"_io.open", # regular 'open()' call
"pathlib.Path.open",
"pathlib._local.Path.open", # Python 3.13
"codecs.open",
"urllib.request.urlopen",
"tempfile.NamedTemporaryFile",
Expand Down Expand Up @@ -1691,7 +1692,7 @@ def _check_consider_using_with(self, node: nodes.Call) -> None:
return
inferred = utils.safe_infer(node.func)
if not inferred or not isinstance(
inferred, (nodes.FunctionDef, nodes.ClassDef, bases.UnboundMethod)
inferred, (nodes.FunctionDef, nodes.ClassDef, bases.BoundMethod)
):
return
could_be_used_in_with = (
Expand Down

0 comments on commit b98e649

Please sign in to comment.