From 56239ec9b29d71f13854407bd9e40e4444cadd8b Mon Sep 17 00:00:00 2001 From: Shahzad Malik Muzaffar Date: Fri, 22 Nov 2024 18:18:37 +0100 Subject: [PATCH 1/2] [MISC3] py2/3 compatibility:drop use of __future__ --- PhysicsTools/NanoAOD/python/nano_cff.py | 1 - PhysicsTools/NanoAODTools/test/exampleGenDump.py | 1 - RecoLocalMuon/GEMCSCSegment/test/plotGEMCSCCoincidenceRate.py | 1 - Validation/EventGenerator/python/genvalidTools.py | 1 - 4 files changed, 4 deletions(-) diff --git a/PhysicsTools/NanoAOD/python/nano_cff.py b/PhysicsTools/NanoAOD/python/nano_cff.py index 5e55613bfb41d..386b78fbb6ca9 100644 --- a/PhysicsTools/NanoAOD/python/nano_cff.py +++ b/PhysicsTools/NanoAOD/python/nano_cff.py @@ -1,4 +1,3 @@ -from __future__ import print_function import FWCore.ParameterSet.Config as cms from PhysicsTools.NanoAOD.common_cff import * from PhysicsTools.NanoAOD.nano_eras_cff import * diff --git a/PhysicsTools/NanoAODTools/test/exampleGenDump.py b/PhysicsTools/NanoAODTools/test/exampleGenDump.py index 1d582c841576b..7fe66af9f0da5 100755 --- a/PhysicsTools/NanoAODTools/test/exampleGenDump.py +++ b/PhysicsTools/NanoAODTools/test/exampleGenDump.py @@ -3,7 +3,6 @@ # https://cms-nanoaod-integration.web.cern.ch/integration/master-106X/mc106Xul18_doc.html#GenPart # https://github.com/cms-sw/cmssw/blob/master/PhysicsTools/NanoAOD/python/genparticles_cff.py # https://github.com/cms-sw/cmssw/blob/master/PhysicsTools/NanoAOD/plugins/LHETablesProducer.cc -from __future__ import print_function # for python3 compatibility from PhysicsTools.NanoAODTools.postprocessing.framework.postprocessor import PostProcessor from PhysicsTools.NanoAODTools.postprocessing.framework.eventloop import Module from PhysicsTools.NanoAODTools.postprocessing.framework.datamodel import Collection diff --git a/RecoLocalMuon/GEMCSCSegment/test/plotGEMCSCCoincidenceRate.py b/RecoLocalMuon/GEMCSCSegment/test/plotGEMCSCCoincidenceRate.py index c374d817f614a..ba3f9f8dca457 100644 --- a/RecoLocalMuon/GEMCSCSegment/test/plotGEMCSCCoincidenceRate.py +++ b/RecoLocalMuon/GEMCSCSegment/test/plotGEMCSCCoincidenceRate.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3.9 -from __future__ import annotations from dataclasses import dataclass from functools import cached_property from typing import Optional diff --git a/Validation/EventGenerator/python/genvalidTools.py b/Validation/EventGenerator/python/genvalidTools.py index 7990401cb2033..da94c1349662b 100644 --- a/Validation/EventGenerator/python/genvalidTools.py +++ b/Validation/EventGenerator/python/genvalidTools.py @@ -1,4 +1,3 @@ -from __future__ import print_function import FWCore.ParameterSet.Config as cms #function to switch to an external weight producer for an analyzer in the validation chain From b589c81a97057d1f0146cab0fa59697ecdf5e657 Mon Sep 17 00:00:00 2001 From: Shahzad Malik Muzaffar Date: Fri, 22 Nov 2024 22:25:11 +0100 Subject: [PATCH 2/2] added back __future__ annotations as it is still not part of python3 --- RecoLocalMuon/GEMCSCSegment/test/plotGEMCSCCoincidenceRate.py | 1 + 1 file changed, 1 insertion(+) diff --git a/RecoLocalMuon/GEMCSCSegment/test/plotGEMCSCCoincidenceRate.py b/RecoLocalMuon/GEMCSCSegment/test/plotGEMCSCCoincidenceRate.py index ba3f9f8dca457..c374d817f614a 100644 --- a/RecoLocalMuon/GEMCSCSegment/test/plotGEMCSCCoincidenceRate.py +++ b/RecoLocalMuon/GEMCSCSegment/test/plotGEMCSCCoincidenceRate.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3.9 +from __future__ import annotations from dataclasses import dataclass from functools import cached_property from typing import Optional