From d6c99d9d2c254783156c9d19cb22af27cce51995 Mon Sep 17 00:00:00 2001 From: Anselm Hahn Date: Sun, 6 Feb 2022 16:25:00 +0100 Subject: [PATCH] Fixed #21 Refactoring `if-if` statements Assignment Expressions via `:=` --- poetry_version_plugin/plugin.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/poetry_version_plugin/plugin.py b/poetry_version_plugin/plugin.py index 1308fa8..a01074b 100644 --- a/poetry_version_plugin/plugin.py +++ b/poetry_version_plugin/plugin.py @@ -26,8 +26,7 @@ def activate(self, poetry: Poetry, io: IO) -> None: io.write_error_line(message) raise RuntimeError(message) if version_source == "init": - packages = poetry.local_config.get("packages") - if packages: + if packages := poetry.local_config.get("packages"): if len(packages) == 1: package_name = packages[0]["include"] else: