diff --git a/pyproject.toml b/pyproject.toml index 992e48391ad..6689d6375eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ requires-python = ">=3.9" [tool.black] required-version = '24' line-length = 88 -target-version = ['py38', 'py39', 'py310', 'py311', 'py312'] +target-version = ['py39', 'py310', 'py311', 'py312', 'py313'] # 'extend-exclude' excludes files or directories in addition to the defaults extend-exclude = ''' ( diff --git a/scripts/g.extension/g.extension.py b/scripts/g.extension/g.extension.py index bf8cd183135..ed0544ee2c4 100644 --- a/scripts/g.extension/g.extension.py +++ b/scripts/g.extension/g.extension.py @@ -470,9 +470,10 @@ def replace_shebang_win(python_file): cur_dir = os.path.dirname(python_file) tmp_name = os.path.join(cur_dir, gs.tempname(12)) - with codecs.open(python_file, "r", encoding="utf8") as in_file, codecs.open( - tmp_name, "w", encoding="utf8" - ) as out_file: + with ( + codecs.open(python_file, "r", encoding="utf8") as in_file, + codecs.open(tmp_name, "w", encoding="utf8") as out_file, + ): for line in in_file: new_line = line.replace( "#!/usr/bin/env python\n", "#!/usr/bin/env python3\n"