From 4ff4a25513fe15f1f96a61f45114bc9aafadbc49 Mon Sep 17 00:00:00 2001 From: Shahzad Malik Muzaffar Date: Mon, 25 Oct 2021 10:16:54 +0200 Subject: [PATCH] [L1] [PY3] Fix needed for python3: Use of subprocess instead of commands --- L1Trigger/Configuration/python/customiseUtils.py | 1 - L1Trigger/L1TCommon/scripts/optionsL1T.py | 1 - L1Trigger/L1TCommon/test/reEmul.py | 1 - L1Trigger/L1TCommon/test/runL1T.py | 1 - L1Trigger/L1TMuon/test/runMuon.py | 1 - L1Trigger/L1TMuonBarrel/test/runMuonBarrel.py | 1 - L1Trigger/L1TMuonBarrel/test/runMuonBarrel_o2o.py | 1 - L1Trigger/L1TMuonEndCap/test/RunTrackFinder_MC.py | 1 - L1Trigger/L1TMuonEndCap/test/RunTrackFinder_data.py | 1 - .../L1TMuonEndCap/test/UnpackTrackFinder_data_2016_10_04.py | 1 - L1Trigger/L1TMuonOverlap/test/expert/mergeGPsXMLFiles.py | 1 - L1Trigger/L1TMuonOverlap/test/expert/runOMTFPatternMaker.py | 4 ++-- L1Trigger/L1TMuonOverlap/test/runMuonOverlap.py | 1 - .../test/expert/omtf/runMuonOverlapDataDump.py | 1 - .../test/expert/omtf/runMuonOverlapPatternGenerator.py | 1 - .../expert/omtf/runMuonOverlapPatternGeneratorClassProb.py | 1 - .../L1TMuonOverlapPhase1/test/runMuonOverlap_run2_data.py | 1 - .../L1TMuonOverlapPhase1/test/runMuonOverlap_run3_data.py | 1 - L1Trigger/L1TMuonOverlapPhase1/test/runMuonOverlap_run3_mc.py | 1 - L1Trigger/L1TTwinMux/test/runMuonBarrel.py | 1 - 20 files changed, 2 insertions(+), 21 deletions(-) diff --git a/L1Trigger/Configuration/python/customiseUtils.py b/L1Trigger/Configuration/python/customiseUtils.py index d938fc9797d61..11602bceda610 100644 --- a/L1Trigger/Configuration/python/customiseUtils.py +++ b/L1Trigger/Configuration/python/customiseUtils.py @@ -3,7 +3,6 @@ import FWCore.ParameterSet.VarParsing as VarParsing import os import sys -import commands ############################################################################## # customisations for L1T utilities # diff --git a/L1Trigger/L1TCommon/scripts/optionsL1T.py b/L1Trigger/L1TCommon/scripts/optionsL1T.py index fe19792167ed0..a73ae05947ddf 100644 --- a/L1Trigger/L1TCommon/scripts/optionsL1T.py +++ b/L1Trigger/L1TCommon/scripts/optionsL1T.py @@ -19,7 +19,6 @@ import FWCore.ParameterSet.VarParsing as VarParsing import os import sys -import commands options = VarParsing.VarParsing ('analysis') options = VarParsing.VarParsing ('analysis') options.register ('ntuple', "", VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, "The output ntuple file name") diff --git a/L1Trigger/L1TCommon/test/reEmul.py b/L1Trigger/L1TCommon/test/reEmul.py index 00c198576d793..ce2f0d31affd6 100644 --- a/L1Trigger/L1TCommon/test/reEmul.py +++ b/L1Trigger/L1TCommon/test/reEmul.py @@ -26,7 +26,6 @@ from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger import os import sys -import commands options = VarParsing.VarParsing ('analysis') diff --git a/L1Trigger/L1TCommon/test/runL1T.py b/L1Trigger/L1TCommon/test/runL1T.py index 24f95f75fef26..61226084704e3 100644 --- a/L1Trigger/L1TCommon/test/runL1T.py +++ b/L1Trigger/L1TCommon/test/runL1T.py @@ -4,7 +4,6 @@ process = cms.Process("L1TMuonEmulation", Run2_2016) import os import sys -import commands process.load("FWCore.MessageLogger.MessageLogger_cfi") diff --git a/L1Trigger/L1TMuon/test/runMuon.py b/L1Trigger/L1TMuon/test/runMuon.py index 1e91175abf21e..d82a5511d077b 100644 --- a/L1Trigger/L1TMuon/test/runMuon.py +++ b/L1Trigger/L1TMuon/test/runMuon.py @@ -3,7 +3,6 @@ process = cms.Process("L1TMuonEmulation", Run2_2016) import os import sys -import commands process.load("FWCore.MessageLogger.MessageLogger_cfi") diff --git a/L1Trigger/L1TMuonBarrel/test/runMuonBarrel.py b/L1Trigger/L1TMuonBarrel/test/runMuonBarrel.py index ee17d0968a816..74f146491828d 100644 --- a/L1Trigger/L1TMuonBarrel/test/runMuonBarrel.py +++ b/L1Trigger/L1TMuonBarrel/test/runMuonBarrel.py @@ -3,7 +3,6 @@ process = cms.Process("L1TMuonEmulation") import os import sys -import commands process.load("FWCore.MessageLogger.MessageLogger_cfi") diff --git a/L1Trigger/L1TMuonBarrel/test/runMuonBarrel_o2o.py b/L1Trigger/L1TMuonBarrel/test/runMuonBarrel_o2o.py index acae41cd55be2..972815d7f2a1f 100644 --- a/L1Trigger/L1TMuonBarrel/test/runMuonBarrel_o2o.py +++ b/L1Trigger/L1TMuonBarrel/test/runMuonBarrel_o2o.py @@ -3,7 +3,6 @@ process = cms.Process("L1TMuonEmulationO2O") import os import sys -import commands process.load("FWCore.MessageLogger.MessageLogger_cfi") diff --git a/L1Trigger/L1TMuonEndCap/test/RunTrackFinder_MC.py b/L1Trigger/L1TMuonEndCap/test/RunTrackFinder_MC.py index 5e8cb24b9468a..160e444cb3db4 100644 --- a/L1Trigger/L1TMuonEndCap/test/RunTrackFinder_MC.py +++ b/L1Trigger/L1TMuonEndCap/test/RunTrackFinder_MC.py @@ -2,7 +2,6 @@ # ## Basic (but usually unnecessary) imports # import os # import sys -# import commands import subprocess diff --git a/L1Trigger/L1TMuonEndCap/test/RunTrackFinder_data.py b/L1Trigger/L1TMuonEndCap/test/RunTrackFinder_data.py index 01eb9890cd257..674c488c53f5a 100644 --- a/L1Trigger/L1TMuonEndCap/test/RunTrackFinder_data.py +++ b/L1Trigger/L1TMuonEndCap/test/RunTrackFinder_data.py @@ -4,7 +4,6 @@ import FWCore.ParameterSet.Config as cms import os import sys -import commands import subprocess process = cms.Process('L1TMuonEmulation') diff --git a/L1Trigger/L1TMuonEndCap/test/UnpackTrackFinder_data_2016_10_04.py b/L1Trigger/L1TMuonEndCap/test/UnpackTrackFinder_data_2016_10_04.py index ea2bbaee01b70..e3ec34327aa9e 100644 --- a/L1Trigger/L1TMuonEndCap/test/UnpackTrackFinder_data_2016_10_04.py +++ b/L1Trigger/L1TMuonEndCap/test/UnpackTrackFinder_data_2016_10_04.py @@ -3,7 +3,6 @@ import FWCore.ParameterSet.Config as cms import os import sys -import commands import subprocess process = cms.Process('L1TMuonEmulation') diff --git a/L1Trigger/L1TMuonOverlap/test/expert/mergeGPsXMLFiles.py b/L1Trigger/L1TMuonOverlap/test/expert/mergeGPsXMLFiles.py index 31e63bd21e8bc..3ecd143128754 100644 --- a/L1Trigger/L1TMuonOverlap/test/expert/mergeGPsXMLFiles.py +++ b/L1Trigger/L1TMuonOverlap/test/expert/mergeGPsXMLFiles.py @@ -2,7 +2,6 @@ process = cms.Process("OMTFEmulation") import os import sys -import commands process.load("FWCore.MessageLogger.MessageLogger_cfi") diff --git a/L1Trigger/L1TMuonOverlap/test/expert/runOMTFPatternMaker.py b/L1Trigger/L1TMuonOverlap/test/expert/runOMTFPatternMaker.py index 6b435c8d289fa..de71b592064e0 100644 --- a/L1Trigger/L1TMuonOverlap/test/expert/runOMTFPatternMaker.py +++ b/L1Trigger/L1TMuonOverlap/test/expert/runOMTFPatternMaker.py @@ -2,7 +2,7 @@ process = cms.Process("OMTFEmulation") import os import sys -import commands +#import subprocess verbose = False @@ -72,7 +72,7 @@ process.source.fileNames = cms.untracked.vstring() path = "/home/akalinow/scratch/CMS/OverlapTrackFinder/Crab/SingleMuFullEta/721_FullEta_v4/data/" command = "ls "+path+"/SingleMu_10_?_*" -fileList = commands.getoutput(command).split("\n") +fileList = subprocess.getoutput(command).split("\n") process.source.fileNames = cms.untracked.vstring() for aFile in fileList: process.source.fileNames.append('file:'+aFile) diff --git a/L1Trigger/L1TMuonOverlap/test/runMuonOverlap.py b/L1Trigger/L1TMuonOverlap/test/runMuonOverlap.py index aeba4bfbd0a24..5bc25fb4cf87e 100644 --- a/L1Trigger/L1TMuonOverlap/test/runMuonOverlap.py +++ b/L1Trigger/L1TMuonOverlap/test/runMuonOverlap.py @@ -3,7 +3,6 @@ process = cms.Process("L1TMuonEmulation") import os import sys -import commands process.load("FWCore.MessageLogger.MessageLogger_cfi") diff --git a/L1Trigger/L1TMuonOverlapPhase1/test/expert/omtf/runMuonOverlapDataDump.py b/L1Trigger/L1TMuonOverlapPhase1/test/expert/omtf/runMuonOverlapDataDump.py index 23524e7b16f5a..46e3c1f61c642 100644 --- a/L1Trigger/L1TMuonOverlapPhase1/test/expert/omtf/runMuonOverlapDataDump.py +++ b/L1Trigger/L1TMuonOverlapPhase1/test/expert/omtf/runMuonOverlapDataDump.py @@ -3,7 +3,6 @@ process = cms.Process("L1TMuonEmulation") import os import sys -import commands import re from os import listdir from os.path import isfile, join diff --git a/L1Trigger/L1TMuonOverlapPhase1/test/expert/omtf/runMuonOverlapPatternGenerator.py b/L1Trigger/L1TMuonOverlapPhase1/test/expert/omtf/runMuonOverlapPatternGenerator.py index 7cc96b792c771..8a389984f769d 100644 --- a/L1Trigger/L1TMuonOverlapPhase1/test/expert/omtf/runMuonOverlapPatternGenerator.py +++ b/L1Trigger/L1TMuonOverlapPhase1/test/expert/omtf/runMuonOverlapPatternGenerator.py @@ -3,7 +3,6 @@ process = cms.Process("L1TMuonEmulation") import os import sys -import commands import re from os import listdir from os.path import isfile, join diff --git a/L1Trigger/L1TMuonOverlapPhase1/test/expert/omtf/runMuonOverlapPatternGeneratorClassProb.py b/L1Trigger/L1TMuonOverlapPhase1/test/expert/omtf/runMuonOverlapPatternGeneratorClassProb.py index 5edc6eecf88bf..b7657122949cf 100644 --- a/L1Trigger/L1TMuonOverlapPhase1/test/expert/omtf/runMuonOverlapPatternGeneratorClassProb.py +++ b/L1Trigger/L1TMuonOverlapPhase1/test/expert/omtf/runMuonOverlapPatternGeneratorClassProb.py @@ -3,7 +3,6 @@ process = cms.Process("L1TMuonEmulation") import os import sys -import commands import re from os import listdir from os.path import isfile, join diff --git a/L1Trigger/L1TMuonOverlapPhase1/test/runMuonOverlap_run2_data.py b/L1Trigger/L1TMuonOverlapPhase1/test/runMuonOverlap_run2_data.py index 5f51e2f08c091..01a08eb03bdb3 100644 --- a/L1Trigger/L1TMuonOverlapPhase1/test/runMuonOverlap_run2_data.py +++ b/L1Trigger/L1TMuonOverlapPhase1/test/runMuonOverlap_run2_data.py @@ -3,7 +3,6 @@ process = cms.Process("L1TMuonEmulation") import os import sys -#import commands process.load("FWCore.MessageLogger.MessageLogger_cfi") diff --git a/L1Trigger/L1TMuonOverlapPhase1/test/runMuonOverlap_run3_data.py b/L1Trigger/L1TMuonOverlapPhase1/test/runMuonOverlap_run3_data.py index 22055e1367aa4..0d39a3466befc 100644 --- a/L1Trigger/L1TMuonOverlapPhase1/test/runMuonOverlap_run3_data.py +++ b/L1Trigger/L1TMuonOverlapPhase1/test/runMuonOverlap_run3_data.py @@ -3,7 +3,6 @@ process = cms.Process("L1TMuonEmulation") import os import sys -#import commands process.load("FWCore.MessageLogger.MessageLogger_cfi") diff --git a/L1Trigger/L1TMuonOverlapPhase1/test/runMuonOverlap_run3_mc.py b/L1Trigger/L1TMuonOverlapPhase1/test/runMuonOverlap_run3_mc.py index 1f3213e54c03b..8c6d0bc87291b 100644 --- a/L1Trigger/L1TMuonOverlapPhase1/test/runMuonOverlap_run3_mc.py +++ b/L1Trigger/L1TMuonOverlapPhase1/test/runMuonOverlap_run3_mc.py @@ -3,7 +3,6 @@ process = cms.Process("L1TMuonEmulation") import os import sys -#import commands process.load("FWCore.MessageLogger.MessageLogger_cfi") diff --git a/L1Trigger/L1TTwinMux/test/runMuonBarrel.py b/L1Trigger/L1TTwinMux/test/runMuonBarrel.py index 459724920da43..81a8824d50d00 100644 --- a/L1Trigger/L1TTwinMux/test/runMuonBarrel.py +++ b/L1Trigger/L1TTwinMux/test/runMuonBarrel.py @@ -3,7 +3,6 @@ process = cms.Process("L1TMuonEmulation") import os import sys -import commands process.load("FWCore.MessageLogger.MessageLogger_cfi")