From 95592787a9c5dc9b384a31f62b570dd3d9d63eb1 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <fwinkl@cern>
Date: Mon, 26 Oct 2020 12:14:21 +0100
Subject: [PATCH] AthenaRootComps: flake8 fixes

---
 .../AthenaRoot/AthenaRootComps/python/AthenaRootBase.py    | 6 ++----
 .../AthenaRoot/AthenaRootComps/python/Configurables.py     | 4 ++--
 .../AthenaRootComps/python/OutputStreamAthenaRoot.py       | 7 +------
 .../AthenaRoot/AthenaRootComps/python/ReadAthenaRoot.py    | 4 ++--
 .../AthenaRoot/AthenaRootComps/python/ReadAthenaxAOD.py    | 4 ++--
 .../AthenaRootComps/python/ReadAthenaxAODHybrid.py         | 4 ++--
 .../AthenaRoot/AthenaRootComps/python/WriteAthenaRoot.py   | 4 ++--
 7 files changed, 13 insertions(+), 20 deletions(-)

diff --git a/Database/AthenaRoot/AthenaRootComps/python/AthenaRootBase.py b/Database/AthenaRoot/AthenaRootComps/python/AthenaRootBase.py
index f95391bd7da..504d298c58b 100644
--- a/Database/AthenaRoot/AthenaRootComps/python/AthenaRootBase.py
+++ b/Database/AthenaRoot/AthenaRootComps/python/AthenaRootBase.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # @file AthenaRootComps/python/AthenaRootBase.py
 # @purpose make the Athena framework write a set of ROOT files
@@ -11,7 +11,7 @@ def _loadBasicAthenaRoot():
 
      from AthenaCommon import CfgMgr
      ## make sure we have been -at least- minimally correctly configured
-     import AthenaCommon.AtlasUnixStandardJob
+     import AthenaCommon.AtlasUnixStandardJob  # noqa: F401
 
      from AthenaCommon.Logging import logging
      from AthenaCommon.AppMgr  import ServiceMgr as svcMgr
@@ -22,8 +22,6 @@ def _loadBasicAthenaRoot():
      svcMgr += CfgMgr.Athena__RootSvc("AthenaRootSvc")
      svcMgr += CfgMgr.Athena__RootCnvSvc("AthenaRootCnvSvc")
 
-     from AthenaCommon.AppMgr import theApp
-
      if not hasattr (svcMgr, 'EventPersistencySvc'):
          svcMgr += CfgMgr.EvtPersistencySvc( "EventPersistencySvc" )
          svcMgr.EventPersistencySvc.CnvServices += [ "AthenaRootCnvSvc" ]
diff --git a/Database/AthenaRoot/AthenaRootComps/python/Configurables.py b/Database/AthenaRoot/AthenaRootComps/python/Configurables.py
index 81fd6a9bbeb..3ea4ff797c7 100644
--- a/Database/AthenaRoot/AthenaRootComps/python/Configurables.py
+++ b/Database/AthenaRoot/AthenaRootComps/python/Configurables.py
@@ -1,11 +1,11 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # @file: Configurables.py
 # @purpose: customized Configurable classes for AthenaRootComps
 # @author: Sebastien Binet <binet@cern.ch>
 
 ### ---------------------------------------------------------------------------
-from AthenaRootComps.OutputStreamAthenaRoot import createNtupleOutputStream
+from AthenaRootComps.OutputStreamAthenaRoot import createNtupleOutputStream  # noqa: F401
 
 ### ---------------------------------------------------------------------------
 ## import the automatically generated Configurables
diff --git a/Database/AthenaRoot/AthenaRootComps/python/OutputStreamAthenaRoot.py b/Database/AthenaRoot/AthenaRootComps/python/OutputStreamAthenaRoot.py
index 2ca1112f58d..2dc7220931d 100644
--- a/Database/AthenaRoot/AthenaRootComps/python/OutputStreamAthenaRoot.py
+++ b/Database/AthenaRoot/AthenaRootComps/python/OutputStreamAthenaRoot.py
@@ -1,16 +1,12 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 ## @file OutputStreamAthenaRoot.py
 ## @brief Helper methods to create output streams
 ## @author Sebastien Binet <binet@cern.ch>, Peter van Gemmeren <gemmeren@bnl.gov>
-## $Id: OutputStreamAthenaRoot.py 723505 2016-02-11 22:29:40Z gemmeren $
 ###############################################################
 
-from __future__ import print_function
-
 import AthenaCommon.CfgMgr as CfgMgr
 from AthenaCommon.AppMgr import theApp
-from AthenaCommon.AppMgr import ServiceMgr as svcMgr
 from AthenaRootComps.AthenaRootCompsConf import Athena__RootOutputStreamTool as AthenaRootOutputStreamTool
 
 def createNtupleOutputStream(streamName, fileName, tupleName="physics", asAlg = False):
@@ -107,7 +103,6 @@ class AthenaRootOutputStreamProtect(CfgMgr.AthenaOutputStream):
     pass
 """
 
-from AthenaCommon import CfgMgr
 class AthenaRootNtupleOutputStreamProtect(CfgMgr.Athena__RootNtupleOutputStream):
     def __init__(self, name='Stream1', **kw):
         kw['name'] = kw.get('name', name)
diff --git a/Database/AthenaRoot/AthenaRootComps/python/ReadAthenaRoot.py b/Database/AthenaRoot/AthenaRootComps/python/ReadAthenaRoot.py
index b11721e3e89..d7a34e04bdd 100644
--- a/Database/AthenaRoot/AthenaRootComps/python/ReadAthenaRoot.py
+++ b/Database/AthenaRoot/AthenaRootComps/python/ReadAthenaRoot.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # @file AthenaRootComps/python/ReadAthenaRoot.py
 # @purpose make the Athena framework read a set of ROOT files to emulate the
@@ -52,7 +52,7 @@ def _configure():
     evtloop = getattr(svcMgr, theApp.EventLoop)
     try:
         evtloop.EventPrintoutInterval = 10000
-    except Exception as err:
+    except Exception:
         msg.info('disabling event loop heartbeat... [failed]')
         msg.info('performances might be sub-par... sorry.')
         pass
diff --git a/Database/AthenaRoot/AthenaRootComps/python/ReadAthenaxAOD.py b/Database/AthenaRoot/AthenaRootComps/python/ReadAthenaxAOD.py
index 36536fac44c..59cce267ff9 100644
--- a/Database/AthenaRoot/AthenaRootComps/python/ReadAthenaxAOD.py
+++ b/Database/AthenaRoot/AthenaRootComps/python/ReadAthenaxAOD.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # @file AthenaRootComps/python/ReadAthenaxAOD.py
 # @purpose make the Athena framework read a set of xAOD files to emulate the
@@ -50,7 +50,7 @@ def _configure():
     evtloop = getattr(svcMgr, theApp.EventLoop)
     try:
         evtloop.EventPrintoutInterval = 10000
-    except Exception as err:
+    except Exception:
         msg.info('disabling event loop heartbeat... [failed]')
         msg.info('performances might be sub-par... sorry.')
         pass
diff --git a/Database/AthenaRoot/AthenaRootComps/python/ReadAthenaxAODHybrid.py b/Database/AthenaRoot/AthenaRootComps/python/ReadAthenaxAODHybrid.py
index d59a60a21ae..3f36a60880c 100644
--- a/Database/AthenaRoot/AthenaRootComps/python/ReadAthenaxAODHybrid.py
+++ b/Database/AthenaRoot/AthenaRootComps/python/ReadAthenaxAODHybrid.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # @file AthenaRootComps/python/ReadAthenaxAODHybrid.py
 # @purpose make the Athena framework read a set of xAOD files to emulate the
@@ -61,7 +61,7 @@ def _configure():
     evtloop = getattr(svcMgr, theApp.EventLoop)
     try:
         evtloop.EventPrintoutInterval = 10000
-    except Exception as err:
+    except Exception:
         msg.info('disabling event loop heartbeat... [failed]')
         msg.info('performances might be sub-par... sorry.')
         pass
diff --git a/Database/AthenaRoot/AthenaRootComps/python/WriteAthenaRoot.py b/Database/AthenaRoot/AthenaRootComps/python/WriteAthenaRoot.py
index 3a7134b8232..a725099a981 100644
--- a/Database/AthenaRoot/AthenaRootComps/python/WriteAthenaRoot.py
+++ b/Database/AthenaRoot/AthenaRootComps/python/WriteAthenaRoot.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # @file AthenaRootComps/python/WriteAthenaRoot.py
 # @purpose make the Athena framework write a set of ROOT files
@@ -19,7 +19,7 @@ def _configureWriteAthenaRoot():
     msg.debug( "Configuring Athena for writing ROOT files..." )
 
     # Load the basic services
-    import AthenaRootComps.AthenaRootBase
+    import AthenaRootComps.AthenaRootBase  # noqa: F401
 
     '''
     from AthenaCommon.AppMgr  import ServiceMgr as svcMgr
-- 
GitLab