From 6b9ec285fda72a169aa7bbe34c7d300c2151811a Mon Sep 17 00:00:00 2001 From: Athanasius Date: Fri, 30 Dec 2022 16:43:58 +0000 Subject: [PATCH] plug.py: Use `x if x else y` not ` or `, & small type cleanup --- plug.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plug.py b/plug.py index d28ce4e6..5bc8c826 100644 --- a/plug.py +++ b/plug.py @@ -407,7 +407,7 @@ def notify_capidata( def notify_capi_fleetcarrierdata( data: companion.CAPIData -) -> Optional[str]: +) -> str | None: """ Send the latest CAPI Fleetcarrier data from the FD servers to each plugin. @@ -421,7 +421,7 @@ def notify_capi_fleetcarrierdata( try: # Pass a copy of the CAPIData in case the callee modifies it newerror = fc_callback(copy.deepcopy(data)) - error = error or newerror + error = error if error else newerror except Exception: logger.exception(f'Plugin "{plugin.name}" failed on receiving Fleetcarrier data')