From bfb383ec617e3781e1506105a17778085d8afa37 Mon Sep 17 00:00:00 2001 From: Roman Hergenreder Date: Sun, 10 Dec 2023 00:18:31 +0100 Subject: [PATCH] util.nvl --- util.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util.py b/util.py index a2c5dea..78d1619 100755 --- a/util.py +++ b/util.py @@ -19,6 +19,9 @@ def is_port_in_use(port): with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: return s.connect_ex(('127.0.0.1', port)) == 0 +def nvl(a, b): + return b if a is None else a + def get_payload_path(path=""): return os.path.realpath(os.path.join(os.path.dirname(__file__), path))