From 865aad85a519284734584b5641400410b4207ac0 Mon Sep 17 00:00:00 2001 From: James Garner Date: Wed, 4 Dec 2024 17:47:27 +1300 Subject: [PATCH] style: use tuple for endswith --- lib/charms/operator_libs_linux/v0/apt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/charms/operator_libs_linux/v0/apt.py b/lib/charms/operator_libs_linux/v0/apt.py index 92fa63d..a6cf907 100644 --- a/lib/charms/operator_libs_linux/v0/apt.py +++ b/lib/charms/operator_libs_linux/v0/apt.py @@ -983,7 +983,7 @@ def filename(self, fname: str) -> None: Args: fname: a filename to write the repository information to. """ - if not fname.endswith(".list") or fname.endswith(".sources"): + if not fname.endswith((".list", ".sources")): raise InvalidSourceError("apt source filenames should end in .list or .sources!") self._filename = fname