From 9b00135554acee68c56c6e73b2aac582757a0425 Mon Sep 17 00:00:00 2001
From: amete <serhanmete@gmail.com>
Date: Thu, 10 Dec 2020 16:36:37 +0100
Subject: [PATCH] PerfMonComps: Do not overwrite variables in the global
 namespace

---
 .../PerfMonComps/python/PerfMonFlags.py              | 12 ++++++------
 .../PerfMonComps/share/PerfMonMTSvc_jobOptions.py    |  7 ++++---
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/Control/PerformanceMonitoring/PerfMonComps/python/PerfMonFlags.py b/Control/PerformanceMonitoring/PerfMonComps/python/PerfMonFlags.py
index 6dddf2c60f60..565bb21ad05d 100644
--- a/Control/PerformanceMonitoring/PerfMonComps/python/PerfMonFlags.py
+++ b/Control/PerformanceMonitoring/PerfMonComps/python/PerfMonFlags.py
@@ -135,22 +135,22 @@ class doMonitoringMT(JobProperty):
             svcMgr += PerfMonMTSvc("PerfMonMTSvc")
         # Setup PerfMonAlg
         from AthenaCommon.AlgSequence import AthSequencer
-        topSequence = AthSequencer("AthAlgSeq")
-        if not hasattr(topSequence, "PerfMonMTAlg"):
+        algSeq = AthSequencer("AthAlgSeq")
+        if not hasattr(algSeq, "PerfMonMTAlg"):
             from PerfMonComps.PerfMonCompsConf import PerfMonMTAlg
-            topSequence += PerfMonMTAlg("PerfMonMTAlg")
+            algSeq += PerfMonMTAlg("PerfMonMTAlg")
         return
 
     def _undo_action(self):
         # Uninstall the service and the algorithm
         from AthenaCommon.AppMgr import ServiceMgr as svcMgr
         from AthenaCommon.AlgSequence import AthSequencer
-        topSequence = AthSequencer("AthAlgSeq")
+        algSeq = AthSequencer("AthAlgSeq")
 
         if hasattr(svcMgr, 'PerfMonMTSvc'):
             del svcMgr.PerfMonMTSvc
-        if hasattr(topSequence, 'PerfMonMTAlg'):
-            del topSequence.PerfMonMTAlg
+        if hasattr(algSeq, 'PerfMonMTAlg'):
+            del algSeq.PerfMonMTAlg
         return
 #
 class doFastMonMT(JobProperty):
diff --git a/Control/PerformanceMonitoring/PerfMonComps/share/PerfMonMTSvc_jobOptions.py b/Control/PerformanceMonitoring/PerfMonComps/share/PerfMonMTSvc_jobOptions.py
index 486cddda601a..b8adada555d2 100644
--- a/Control/PerformanceMonitoring/PerfMonComps/share/PerfMonMTSvc_jobOptions.py
+++ b/Control/PerformanceMonitoring/PerfMonComps/share/PerfMonMTSvc_jobOptions.py
@@ -31,8 +31,9 @@ if not hasattr(svcMgr, 'PerfMonMTSvc'):
 # Load PerfMonMTAlg
 ###############################
 from AthenaCommon.AlgSequence import AthSequencer
-topSequence = AthSequencer("AthAlgSeq")
-if not hasattr(topSequence, "PerfMonMTAlg"):
+algSeq = AthSequencer("AthAlgSeq")
+if not hasattr(algSeq, "PerfMonMTAlg"):
     from PerfMonComps.PerfMonCompsConf import PerfMonMTAlg
-    topSequence += PerfMonMTAlg("PerfMonMTAlg")
+    algSeq += PerfMonMTAlg("PerfMonMTAlg")
     pass
+del algSeq
-- 
GitLab