diff --git a/tools/find_deprecated.py b/tools/find_deprecated.py index 48b8efe6d3a9..5c2d43dc95c1 100755 --- a/tools/find_deprecated.py +++ b/tools/find_deprecated.py @@ -133,8 +133,7 @@ def group_by(self, attribute_idx: str) -> None: @staticmethod def find_deprecations(file_name: Path) -> list[Deprecation]: """Runs the deprecation finder on file_name""" - with open(file_name, encoding="utf-8") as fp: - code = fp.read() + code = Path(file_name).read_text() mod = ast.parse(code, file_name) decorator_visitor = DecoratorVisitor(file_name) decorator_visitor.visit(mod)