From 522004b73be20758d66cf0cfbd2ee7f6948a9919 Mon Sep 17 00:00:00 2001 From: "pixeebot[bot]" <104101892+pixeebot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 13:06:29 +0000 Subject: [PATCH] Use Assignment Expression (Walrus) In Conditional --- src/core_codemods/timezone_aware_datetime.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core_codemods/timezone_aware_datetime.py b/src/core_codemods/timezone_aware_datetime.py index d3d84592..bca4103a 100644 --- a/src/core_codemods/timezone_aware_datetime.py +++ b/src/core_codemods/timezone_aware_datetime.py @@ -74,9 +74,8 @@ def leave_Call(self, original_node: cst.Call, updated_node: cst.Call): return updated_node def _determine_module_and_kwarg(self, original_node: cst.Call): - maybe_name = self.get_aliased_prefix_name(original_node, self._module_name) - if maybe_name: + if maybe_name := self.get_aliased_prefix_name(original_node, self._module_name): # it's a regular import OR alias import if maybe_name == self._module_name: module = "datetime.datetime"