From 77e6d1b09956cf38fa8d2722bd9c88919f5c43c2 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 9 Dec 2023 13:51:51 +0200 Subject: [PATCH] PyLint fix for Python 3.12 --- platformio/fs.py | 3 ++- tests/project/test_config.py | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/platformio/fs.py b/platformio/fs.py index d6e1e676..c70a554e 100644 --- a/platformio/fs.py +++ b/platformio/fs.py @@ -223,6 +223,7 @@ def rmtree(path): err=True, ) + # pylint: disable=unexpected-keyword-arg, deprecated-argument if sys.version_info < (3, 12): return shutil.rmtree(path, onerror=_onexc) - return shutil.rmtree(path, onexc=_onexc) # pylint: disable=unexpected-keyword-arg + return shutil.rmtree(path, onexc=_onexc) diff --git a/tests/project/test_config.py b/tests/project/test_config.py index 06e92a32..3f368fe1 100644 --- a/tests/project/test_config.py +++ b/tests/project/test_config.py @@ -654,7 +654,7 @@ def test_nested_interpolation(tmp_path: Path): """ [platformio] build_dir = /tmp/pio-$PROJECT_HASH -data_dir = /$PROJECT_DIR/assets +data_dir = $PROJECT_DIR/assets [env:myenv] build_flags = -D UTIME=${UNIX_TIME} @@ -668,7 +668,9 @@ test_testing_command = """ ) config = ProjectConfig(str(project_conf)) - assert config.get("platformio", "data_dir") == "/$PROJECT_DIR/assets" + assert config.get("platformio", "data_dir").endswith( + os.path.join("$PROJECT_DIR", "assets") + ) assert config.get("env:myenv", "build_flags")[0][-10:].isdigit() testing_command = config.get("env:myenv", "test_testing_command") assert "$" not in " ".join(testing_command)