diff --git a/Control/AthenaCommon/CMakeLists.txt b/Control/AthenaCommon/CMakeLists.txt index 68b6abb7516397436190722ad3c9ce9c43f0442a..a29b6dca8c2a5a6d3a5b553f41eacd849e669c86 100644 --- a/Control/AthenaCommon/CMakeLists.txt +++ b/Control/AthenaCommon/CMakeLists.txt @@ -33,5 +33,5 @@ atlas_add_test( CFElementsTest SCRIPT python -m unittest -v AthenaCommon.CFEleme # Check python syntax: atlas_add_test( flake8 - SCRIPT flake8 --select=F,E101,E112,E113,E7,E9,W6 --ignore=E701 ${CMAKE_CURRENT_SOURCE_DIR}/python + SCRIPT flake8 --select=F,E101,E112,E113,E7,E9,W6 --ignore=E701,E741 ${CMAKE_CURRENT_SOURCE_DIR}/python POST_EXEC_SCRIPT nopost.sh ) diff --git a/Control/AthenaCommon/python/CfgMergerLib.py b/Control/AthenaCommon/python/CfgMergerLib.py index f0d05cf7e6303771779c554517bd11f9f638aee6..4eb2394b4994bb014e0cb0e3dad6eca0ac859b41 100644 --- a/Control/AthenaCommon/python/CfgMergerLib.py +++ b/Control/AthenaCommon/python/CfgMergerLib.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration # @file AthenaCommon/python/CfgMergerLib # @purpose a set of python tools to analyze configurables and find candidates @@ -188,7 +188,7 @@ def dump_josvc_content(fname='josvc.ascii'): cfg = dict(cfg) print >> f, "# content of the joboptions-svc" - print >> f, "josvc_catalog = \ " + print >> f, "josvc_catalog = \\ " from pprint import pprint pprint(cfg, stream=f) diff --git a/Control/AthenaCommon/python/ConfigurationShelve.py b/Control/AthenaCommon/python/ConfigurationShelve.py index e3add9820caf944045547fcc1721cccae941ac89..4038da3a33a3e1e818c25f02f16e78789c085cad 100644 --- a/Control/AthenaCommon/python/ConfigurationShelve.py +++ b/Control/AthenaCommon/python/ConfigurationShelve.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration # @file: AthenaCommon/python/ConfigurationShelve.py # @author: Wim Lavrijsen (WLavrijsen@lbl.gov) @@ -311,7 +311,7 @@ def loadJobOptionsCatalogue( cfg_fname ): p = gaudi.StringProperty( n, '' ) try: p.fromString(v).ignore() - except: + except Exception: print "Failed to convert",n,v if not josvc.addPropertyToCatalogue( client, p ).isSuccess(): diff --git a/Control/AthenaCommon/python/DumpProperties.py b/Control/AthenaCommon/python/DumpProperties.py index d914322c3f9075cbe58e1014eea8915252669403..21f5805c2fab5104e0d21e9ddb5040e141270e7f 100755 --- a/Control/AthenaCommon/python/DumpProperties.py +++ b/Control/AthenaCommon/python/DumpProperties.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration # File: AthenaCommon/python/DumpProperties.py # Author: Wim Lavrijsen (WLavrijsen@lbl.gov) @@ -76,7 +76,7 @@ def pprint( obj, stream = sys.stdout ): if not obj._ip: try: value = eval( value ) - except: + except Exception: pass if value and type(value) == list: diff --git a/Control/AthenaCommon/python/Include.py b/Control/AthenaCommon/python/Include.py index 6081b56bf06caf9d116bed1a5334693512975af2..e7816b84f537a739627c79198a31a32963cbce76 100755 --- a/Control/AthenaCommon/python/Include.py +++ b/Control/AthenaCommon/python/Include.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration # File: AthenaCommon/python/Include.py # Author: Wim Lavrijsen (WLavrijsen@lbl.gov) @@ -57,7 +57,7 @@ class IncludeError( RuntimeError ): ### files locator ------------------------------------------------------------ try: optionsPathEnv = os.environ[ 'JOBOPTSEARCHPATH' ] -except: +except Exception: optionsPathEnv = os.curdir optionsPath = re.split( ',|' + os.pathsep, optionsPathEnv ) @@ -232,7 +232,7 @@ class Include( object ): try: if 'import' in _filecache[ f.f_code.co_filename ][ f.f_lineno ]: return self._trace_include - except: + except Exception: pass f = f.f_back del f diff --git a/Control/AthenaCommon/python/JobProperties.py b/Control/AthenaCommon/python/JobProperties.py index 2b19ec588ba06194274c8b406bf69c58be97c629..4afe912fc3e60abdc08d04481d689ebc9cc3c253 100755 --- a/Control/AthenaCommon/python/JobProperties.py +++ b/Control/AthenaCommon/python/JobProperties.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration #======================================================================= # File: JobProperties/python/JobProperties.py @@ -483,13 +483,13 @@ class JobPropertyContainer (object): closestMatch=get_close_matches(name,self.__dict__.keys(),1) if len(closestMatch)>0: errString+=". Did you mean \'%s\'?" % closestMatch[0] - except: + except Exception: pass #No execption from here raise AttributeError(errString) try: protected=hasattr(self.__dict__[name],'_context_name') - except: + except Exception: protected=False if not protected: self.__dict__[name] = n_value diff --git a/Control/AthenaConfiguration/python/ComponentAccumulator.py b/Control/AthenaConfiguration/python/ComponentAccumulator.py index 15e71f94d961c2f19bbddb85ec25f8b7c82691f6..a85a9ffc3d2a1fbb4a153ceaefa517b3b1af8924 100644 --- a/Control/AthenaConfiguration/python/ComponentAccumulator.py +++ b/Control/AthenaConfiguration/python/ComponentAccumulator.py @@ -90,13 +90,13 @@ class ComponentAccumulator(object): return seq.getValuedProperties()[name] return seq.getDefaultProperties()[name] - self._msg.info( " "*nestLevel +"\__ "+ seq.name() +" (seq: %s %s)" %( "SEQ" if __prop("Sequential") else "PAR", "OR" if __prop("ModeOR") else "AND" ) ) + self._msg.info( " "*nestLevel +"\\__ "+ seq.name() +" (seq: %s %s)" %( "SEQ" if __prop("Sequential") else "PAR", "OR" if __prop("ModeOR") else "AND" ) ) nestLevel += 3 for c in seq.getChildren(): if isSequence(c): printSeqAndAlgs(c, nestLevel ) else: - self._msg.info( " "*nestLevel +"\__ "+ c.name() +" (alg)" ) + self._msg.info( " "*nestLevel +"\\__ "+ c.name() +" (alg)" ) if summariseProps: printProperties(c, nestLevel) printSeqAndAlgs(self._sequence) @@ -251,7 +251,7 @@ class ComponentAccumulator(object): #The following is to work with internal list of service as well as gobal svcMgr as second parameter try: compList.append(newComp) - except: + except Exception: compList+=newComp pass return True #True means something got added diff --git a/Control/AthenaConfiguration/python/UnifyProperties.py b/Control/AthenaConfiguration/python/UnifyProperties.py index dbbb6d968d1a8b7cbadbe94622c653acc1cbeb49..2781f6d40a1cf5bfa0100dff59849e8f64562b78 100644 --- a/Control/AthenaConfiguration/python/UnifyProperties.py +++ b/Control/AthenaConfiguration/python/UnifyProperties.py @@ -63,7 +63,7 @@ def getUnificationKey(propname): if matchingByObject in _propsToUnify: return matchingByObject - except: + except Exception: pass return None diff --git a/External/AtlasPyFwdBwdPorts/CMakeLists.txt b/External/AtlasPyFwdBwdPorts/CMakeLists.txt index 12655407ce549e8e2ecef70acef6a3336c9f693c..6bdc5a22dffaaa8fb3af3ef5e95ed9df4781c051 100644 --- a/External/AtlasPyFwdBwdPorts/CMakeLists.txt +++ b/External/AtlasPyFwdBwdPorts/CMakeLists.txt @@ -124,14 +124,14 @@ _setup_python_package( jsonpickle # Install pyflakes: _setup_python_package( pyflakes - ${CMAKE_CURRENT_SOURCE_DIR}/src/pyflakes-1.5.0.tar.gz - 84a99f05e5409f8196325dda3f5a1b9a + ${CMAKE_CURRENT_SOURCE_DIR}/src/pyflakes-2.0.0.tar.gz + 06310b7c7a288c6c8e8f955da5f985ca SINGLE_VERSION ) # Install flake8: _setup_python_package( flake8 - ${CMAKE_CURRENT_SOURCE_DIR}/src/flake8-3.3.0.tar.gz - 3df622aac9bad27c04f34164609bbed8 + ${CMAKE_CURRENT_SOURCE_DIR}/src/flake8-3.6.0.tar.gz + 178485aed0799655d0cbf2e3bdcfaddc DEPENDS pyflakes SINGLE_VERSION ) @@ -155,8 +155,8 @@ _setup_python_package( mccabe # Install : _setup_python_package( pycodestyle - ${CMAKE_CURRENT_SOURCE_DIR}/src/pycodestyle-2.3.1.tar.gz - 240e342756af30cae0983b16303a2055 + ${CMAKE_CURRENT_SOURCE_DIR}/src/pycodestyle-2.4.0.tar.gz + 85bbebd2c90d2f833c1db467d4d0e9a3 SINGLE_VERSION ) # Install pyinotify: diff --git a/External/AtlasPyFwdBwdPorts/src/flake8-3.3.0.tar.gz b/External/AtlasPyFwdBwdPorts/src/flake8-3.3.0.tar.gz deleted file mode 100644 index 9b44bcb6c48d45608178a020f452f86b3b1f1c3b..0000000000000000000000000000000000000000 Binary files a/External/AtlasPyFwdBwdPorts/src/flake8-3.3.0.tar.gz and /dev/null differ diff --git a/External/AtlasPyFwdBwdPorts/src/flake8-3.6.0.tar.gz b/External/AtlasPyFwdBwdPorts/src/flake8-3.6.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..8490781980b381b5ad119e8a585e6aa0c03977f0 Binary files /dev/null and b/External/AtlasPyFwdBwdPorts/src/flake8-3.6.0.tar.gz differ diff --git a/External/AtlasPyFwdBwdPorts/src/pycodestyle-2.3.1.tar.gz b/External/AtlasPyFwdBwdPorts/src/pycodestyle-2.3.1.tar.gz deleted file mode 100644 index 76de22256ccb0d2dc36056a734cf935405e2408d..0000000000000000000000000000000000000000 Binary files a/External/AtlasPyFwdBwdPorts/src/pycodestyle-2.3.1.tar.gz and /dev/null differ diff --git a/External/AtlasPyFwdBwdPorts/src/pycodestyle-2.4.0.tar.gz b/External/AtlasPyFwdBwdPorts/src/pycodestyle-2.4.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..193aa08cb6c46769d5e8305ec89f8ea6e74b2e72 Binary files /dev/null and b/External/AtlasPyFwdBwdPorts/src/pycodestyle-2.4.0.tar.gz differ diff --git a/External/AtlasPyFwdBwdPorts/src/pyflakes-1.5.0.tar.gz b/External/AtlasPyFwdBwdPorts/src/pyflakes-1.5.0.tar.gz deleted file mode 100644 index 7815ed8a17df702d5e50163ee7596543c3ba6016..0000000000000000000000000000000000000000 Binary files a/External/AtlasPyFwdBwdPorts/src/pyflakes-1.5.0.tar.gz and /dev/null differ diff --git a/External/AtlasPyFwdBwdPorts/src/pyflakes-2.0.0.tar.gz b/External/AtlasPyFwdBwdPorts/src/pyflakes-2.0.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..95d6d3e5d514d517dab6ff358ae26190e6aae9bf Binary files /dev/null and b/External/AtlasPyFwdBwdPorts/src/pyflakes-2.0.0.tar.gz differ diff --git a/HLT/Trigger/TrigControl/TrigCommon/bin/athenaHLT.py b/HLT/Trigger/TrigControl/TrigCommon/bin/athenaHLT.py index 1a8e7bb85926709e063828dc35d2a0678218d79c..e2618adc6dd883dda5a7ad9fd4d45e67508f6bef 100755 --- a/HLT/Trigger/TrigControl/TrigCommon/bin/athenaHLT.py +++ b/HLT/Trigger/TrigControl/TrigCommon/bin/athenaHLT.py @@ -76,7 +76,7 @@ def arg_ros2rob(s): if type(ros2robdict) is not dict: raise(ValueError) return ros2robdict - except: + except Exception: sys.stderr.write("ERROR! ros2rob cannot be evaluated as it is not a proper python dictionary: {}\n".format(s)) sys.stderr.write("Using empty ros2rob dictionary instead\n") return {} diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigGetter.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigGetter.py index 6558072e19c4ef222e53211c2f566620342ebe01..7c817028a5ab9d956482ffc841113c5912602652 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigGetter.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigGetter.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration __author__ = 'J. Stelzer' @@ -248,7 +248,7 @@ class TriggerConfigGetter(Configured): ### preparations are done! try: self.svc.SetStates( self.ConfigSrcList ) - except: + except Exception as ex: log.error( 'Failed to set state of TrigConfigSvc to %r' % self.ConfigSrcList ) else: log.info('The following configuration services will be tried: %r' % self.ConfigSrcList ) @@ -256,7 +256,7 @@ class TriggerConfigGetter(Configured): try: self.svc.InitialiseSvc() - except Exception, ex: + except Exception as ex: log.error( 'Failed to activate TrigConfigSvc: %r' % ex ) if self.readTriggerDB: