diff --git a/Trigger/TrigValidation/TrigValTools/bin/filterREGTEST.py b/Trigger/TrigValidation/TrigValTools/bin/filterREGTEST.py index 34f96a70c1887712da196e555aa79aa52417a633..a21553eb4b5d67552cca2b21da64ccb8c12402cf 100755 --- a/Trigger/TrigValidation/TrigValTools/bin/filterREGTEST.py +++ b/Trigger/TrigValidation/TrigValTools/bin/filterREGTEST.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration """ filterREGTEST.py Filter to remove DEBUG messages but keep REGTEST messages. @@ -11,7 +11,7 @@ import re def main(): if len(sys.argv)>1: - print __doc__ + print(__doc__) return 1 re_debug = re.compile('\S+\s+DEBUG.*') @@ -20,14 +20,14 @@ def main(): if re_debug.match(line)!=None and line.find("REGTEST")==-1: pass else: - print line, + print(line, end=' ') return 0 if __name__ == "__main__": try: sys.exit(main()) - except IOError, e: + except IOError as e: (code, msg) = e if (code==32): pass # ignore broken pipe exception else: raise e diff --git a/Trigger/TrigValidation/TrigValTools/bin/histSizes.py b/Trigger/TrigValidation/TrigValTools/bin/histSizes.py index e86e5997ede850aa5f9b60627f92246ffa5658f8..4ea3c2d3d37fa9c8d83adc8886b21f857c10828f 100755 --- a/Trigger/TrigValidation/TrigValTools/bin/histSizes.py +++ b/Trigger/TrigValidation/TrigValTools/bin/histSizes.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration """Print number of histograms in ROOT file""" import sys @@ -109,24 +109,24 @@ def main(): if not opts.byAlg: opts.byName = True if opts.byName==True: - for h,v in sorted(hists.iteritems(), key=sortKey): - print '%-80s %10s %10s' % (h,v[0],v[1]) + for h,v in sorted(hists.items(), key=sortKey): + print('%-80s %10s %10s' % (h,v[0],v[1])) if opts.byAlg==True: algs = byAlg(hists) - for h,v in sorted(algs.iteritems(), key=sortKey): - print '%-80s %10s %10s' % (h,v[0],v[1]) + for h,v in sorted(algs.items(), key=sortKey): + print('%-80s %10s %10s' % (h,v[0],v[1])) if opts.total: - print - print "Total histograms: %15s" % len(hists) - print "Total %sbins: %15s" % ("filled " if opts.filled else "", sum([h[1] for h in hists.values()])) + print() + print("Total histograms: %15s" % len(hists)) + print("Total %sbins: %15s" % ("filled " if opts.filled else "", sum([h[1] for h in hists.values()]))) if __name__ == '__main__': try: sys.exit(main()) - except IOError, e: + except IOError as e: (code, msg) = e if (code==32): pass # ignore broken pipe exception else: raise e