From 6c0e2767810f24b46420ee02840fee5cb7c2360a Mon Sep 17 00:00:00 2001 From: Kenyi Hurtado Date: Tue, 24 Sep 2024 13:30:09 -0400 Subject: [PATCH] Add python 3.9 suport for Watchdog.isAlive() --- src/python/WMCore/WMRuntime/Watchdog.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/python/WMCore/WMRuntime/Watchdog.py b/src/python/WMCore/WMRuntime/Watchdog.py index 05dcd3e1ec..f7e535047c 100644 --- a/src/python/WMCore/WMRuntime/Watchdog.py +++ b/src/python/WMCore/WMRuntime/Watchdog.py @@ -327,3 +327,16 @@ def initMonitorFwk(self, monitorCfg, updatorCfg): # self._MonMgr.loadMonitors() # self._MonMgr.loadUpdators() return + + def isAlive(self): + """ + :return whether this class thread is alive or not. + """ + try: + # For python 3.8 and below + value = super(Watchdog, self).isAlive() + except AttributeError: + # For python 3.9 and above + value = self.is_alive() + + return value