From 5b00550ac13d49b9580d9eb7aa3a04f0692cfcc0 Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Wed, 23 Oct 2024 10:53:00 +0200 Subject: [PATCH] configuration: Update arguments type for delete_config The deprecated delete_config function supports passing a list of ConfigFile enumerations. Update argument typing accordingly. Signed-off-by: Pieter De Gendt --- src/west/configuration.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/west/configuration.py b/src/west/configuration.py index 251171de..10fd8bef 100644 --- a/src/west/configuration.py +++ b/src/west/configuration.py @@ -40,7 +40,7 @@ from pathlib import PureWindowsPath, Path import platform from enum import Enum -from typing import Any, Dict, Iterable, List, Optional, Tuple, TYPE_CHECKING +from typing import Any, Dict, Iterable, List, Optional, Tuple, TYPE_CHECKING, Union import warnings from west.util import WEST_DIR, west_dir, WestNotFound, PathType @@ -491,7 +491,7 @@ def update_config(section: str, key: str, value: Any, config.write(f) def delete_config(section: str, key: str, - configfile: Optional[ConfigFile] = None, + configfile: Union[Optional[ConfigFile], List[ConfigFile]] = None, topdir: Optional[PathType] = None) -> None: '''Delete the option section.key from the given file or files.