diff --git a/DDCore/python/dd4hepFactories.py b/DDCore/python/dd4hepFactories.py index ce72655990dd52d2eeb9a9e7bb908eb29c58ed57..71eba0ba1d97cb3610b0b34f05d5a96fbeffee79 100755 --- a/DDCore/python/dd4hepFactories.py +++ b/DDCore/python/dd4hepFactories.py @@ -104,7 +104,7 @@ class ComponentDumper: "<D> to DUMP the list of components \n"+ "<S> to SKIP this particular library\n"+ "<L> to no longer LOAD libraries \n") - except Exception,X: + except Exception as X: ret = 'D' if not len(ret): ret = 'D' @@ -156,13 +156,13 @@ try: from ROOT import gROOT from ROOT import gSystem gROOT.SetBatch(1) -except ImportError,X: +except ImportError as X: logger.error('PyROOT interface not accessible: %s',str(X)) sys.exit(errno.ENOENT) try: import dd4hep -except ImportError,X: +except ImportError as X: logger.error('dd4hep python interface not accessible: %s',str(X)) sys.exit(errno.ENOENT) diff --git a/DDG4/examples/readHEPMC.py b/DDG4/examples/readHEPMC.py index 43cbf49da9a852dcb6bb5b4a52724c277c1a7841..4e70ce2404dc776e3ff937319bbaef4177ffcd30 100644 --- a/DDG4/examples/readHEPMC.py +++ b/DDG4/examples/readHEPMC.py @@ -31,7 +31,7 @@ def run(input_file): try: ret = gen.readParticles(evtid,prim_vtx,parts) evtid = evtid + 1 - except Exception,X: + except Exception as X: logger.error( '\nException: readParticles: %s',str(X)) ret = None if ret: diff --git a/DDG4/python/checkGeometry.py b/DDG4/python/checkGeometry.py index 813ce657aadc1908901c0d7ad47d67d3db84b1a9..b5e6dcec122847b414991431cc7495ec0098c62d 100755 --- a/DDG4/python/checkGeometry.py +++ b/DDG4/python/checkGeometry.py @@ -63,13 +63,13 @@ try: import ROOT from ROOT import gROOT gROOT.SetBatch(1) -except ImportError,X: +except ImportError as X: logger.error('PyROOT interface not accessible: %s',str(X)) sys.exit(errno.ENOENT) try: import dd4hep -except ImportError,X: +except ImportError as X: logger.error('dd4hep python interface not accessible: %s',str(X)) sys.exit(errno.ENOENT) diff --git a/DDG4/python/checkOverlaps.py b/DDG4/python/checkOverlaps.py index 2ea26a344c0fa3d2c4174bc1ed27b08334f3031c..b687439b898571d2dca0b9bf1099ec5725426e50 100755 --- a/DDG4/python/checkOverlaps.py +++ b/DDG4/python/checkOverlaps.py @@ -47,14 +47,14 @@ try: import ROOT from ROOT import gROOT gROOT.SetBatch(1) -except ImportError,X: +except ImportError as X: logger.error('PyROOT interface not accessible: %s',str(X)) logger.error("%s",parser.format_help()) sys.exit(errno.ENOENT) try: import dd4hep -except ImportError,X: +except ImportError as X: logger.error('dd4hep python interface not accessible: %s',str(X)) logger.error("%s",parser.format_help()) sys.exit(errno.ENOENT) diff --git a/DDG4/python/g4MaterialScan.py b/DDG4/python/g4MaterialScan.py index c5029e32004e5ae4dc072f810a16c2d52167701d..c5698a0d7b1b574a90be2335327c37a37c6843ec 100644 --- a/DDG4/python/g4MaterialScan.py +++ b/DDG4/python/g4MaterialScan.py @@ -107,14 +107,14 @@ try: import ROOT from ROOT import gROOT gROOT.SetBatch(1) -except ImportError,X: +except ImportError as X: logger.error('PyROOT interface not accessible: %s', X) logger.info(parser.format_help()) sys.exit(errno.ENOENT) try: import DDG4, SystemOfUnits -except ImportError,X: +except ImportError as X: logger.error('DDG4 python interface not accessible: %s', X) logger.info(parser.format_help()) sys.exit(errno.ENOENT) diff --git a/DDRec/python/dumpDetectorData.py b/DDRec/python/dumpDetectorData.py index f317a4f742007f2a097887d5e635953ecc7a6c74..e8af8ded259d819227e2c4bfcb43082ec506ff4f 100644 --- a/DDRec/python/dumpDetectorData.py +++ b/DDRec/python/dumpDetectorData.py @@ -67,21 +67,21 @@ try: import ROOT from ROOT import gROOT gROOT.SetBatch(1) -except ImportError,X: +except ImportError as X: logger.error('PyROOT interface not accessible: %s',str(X)) logger.error("%s",parser.format_help()) sys.exit(errno.ENOENT) try: import dd4hep -except ImportError,X: +except ImportError as X: logger.error('dd4hep python interface not accessible: %s',str(X)) logger.error("%s",parser.format_help()) sys.exit(errno.ENOENT) # try: import DDRec -except ImportError,X: +except ImportError as X: logger.error('ddrec python interface not accessible: %s',str(X)) logger.error("%s",parser.format_help()) sys.exit(errno.ENOENT)