From b512ae78085853e2ca54e4ba8c3746b68830f3d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20S=C5=82awecki?= Date: Fri, 30 Aug 2024 15:12:24 +0200 Subject: [PATCH] Use `io.open_code` for reading code --- backend.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend.py b/backend.py index 2012acc..17ef5ae 100644 --- a/backend.py +++ b/backend.py @@ -166,10 +166,11 @@ def build_editable(wheel_directory, config_settings=None, metadata_directory=Non def proxy(): return textwrap.dedent(f""" + import io __path__ = [{os.getcwd()!r}] __file__ = __path__[0] + '/__init__.py' try: - strm = open(__file__, 'rb') + strm = io.open_code(__file__) except FileNotFoundError: pass else: