Skip to content
Snippets Groups Projects
Commit 58d8b69a authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

flake8 fixes for various scripts

parent 3b4a1272
No related branches found
No related tags found
1 merge request!1441Add flake8 pre-commit hook
#!/usr/bin/env python3
#####################################################################################
# (c) Copyright 1998-2020 CERN for the benefit of the LHCb and ATLAS collaborations #
# (c) Copyright 1998-2023 CERN for the benefit of the LHCb and ATLAS collaborations #
# #
# This software is distributed under the terms of the Apache version 2 licence, #
# copied verbatim in the file "LICENSE". #
......@@ -15,8 +15,8 @@ import shelve
import sys
from optparse import OptionParser
from GaudiKernel.DataHandle import DataHandle
from GaudiKernel.GaudiHandles import *
from GaudiKernel.DataHandle import DataHandle # noqa: F401
from GaudiKernel.GaudiHandles import * # noqa: F401 F403
parser = OptionParser( # desc='simple script to merge files',
usage="%prog [options] input1 input2 ... [output|--output output]"
......@@ -72,7 +72,7 @@ if __name__ == "__main__":
open(output + ".db", "w") # make a dummy ".db" version
elif os.path.exists(output + ".db"): # this Python uses dbm.ndbm
open(output, "w") # make a dummy version without the artificial ".db"
except:
except Exception:
if os.path.exists(output):
os.remove(output)
raise
#!/usr/bin/env python
#####################################################################################
# (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations #
# (c) Copyright 1998-2023 CERN for the benefit of the LHCb and ATLAS collaborations #
# #
# This software is distributed under the terms of the Apache version 2 licence, #
# copied verbatim in the file "LICENSE". #
......@@ -53,7 +53,7 @@ if __name__ == "__main__":
with open(output, "wb") as out:
for input in inputs:
out.writelines(open(input, "rb"))
except:
except Exception:
if os.path.exists(output):
os.remove(output)
raise
#!/usr/bin/env python
#####################################################################################
# (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations #
# (c) Copyright 1998-2023 CERN for the benefit of the LHCb and ATLAS collaborations #
# #
# This software is distributed under the terms of the Apache version 2 licence, #
# copied verbatim in the file "LICENSE". #
......@@ -14,7 +14,6 @@ from __future__ import print_function
import os
import shutil
import sys
import time
import xml.parsers.expat
from subprocess import Popen
......@@ -62,7 +61,7 @@ if __name__ == "__main__":
cmask = []
invmask = []
sampling_period = []
if type([]) != type(es.EVENT):
if not isinstance(es.EVENT, list):
es.EVENT = [es.EVENT]
for x in range(len(es.EVENT)):
counter.append(es.EVENT[x].NAME)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment