Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CORE] py2/3 compatibility:drop use of __future__ #46769

Merged
merged 1 commit into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion DataFormats/FWLite/test/chainEvent_python.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#! /usr/bin/env python3

from __future__ import print_function
from builtins import range
from DataFormats.FWLite import Events, Handle

Expand Down
1 change: 0 additions & 1 deletion DataFormats/FWLite/test/pyroot_multichain.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#! /usr/bin/env python3
from __future__ import print_function
import ROOT
from DataFormats.FWLite import Events, Handle
import FWCore.ParameterSet.VarParsing as VarParsing
Expand Down
1 change: 0 additions & 1 deletion Documentation/DataFormats/python/dataformats.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function

import cStringIO,operator
from functools import reduce
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function
from __future__ import absolute_import
import json, urllib2, os, sys
from bs4 import BeautifulSoup

Expand Down
2 changes: 0 additions & 2 deletions Documentation/ReferenceManualScripts/python/TableParser.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function
from __future__ import absolute_import
# email: [email protected], [email protected]

# please have a look at the namespaces.html (namespace list) and annotated.html
Expand Down
1 change: 0 additions & 1 deletion FWCore/Concurrency/scripts/edmStreamStallGrapher.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
from __future__ import print_function
from builtins import range
from itertools import groupby
from operator import attrgetter,itemgetter
Expand Down
1 change: 0 additions & 1 deletion FWCore/Framework/test/transition_test_cfg.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import FWCore.ParameterSet.Config as cms
import sys

Expand Down
1 change: 0 additions & 1 deletion FWCore/Integration/python/allowed_cff.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import
import FWCore.ParameterSet.Config as cms

from . import restricted_cff
1 change: 0 additions & 1 deletion FWCore/Integration/python/forbidden_cff.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import
import FWCore.ParameterSet.Config as cms

from . import restricted_cff
1 change: 0 additions & 1 deletion FWCore/MessageLogger/scripts/edmFjrDump
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3

from __future__ import print_function
import xml.etree.ElementTree as ET
import argparse

Expand Down
1 change: 0 additions & 1 deletion FWCore/MessageLogger/scripts/edmMLParser
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#! /usr/bin/env python3

from __future__ import print_function

def manipulate_log(logfile_name,category_names,printBeginEvent,printMessageLabel,verbosityLevel):

Expand Down
1 change: 0 additions & 1 deletion FWCore/Modules/python/customiseCheckEventSetup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import FWCore.ParameterSet.Config as cms

def customise(process):
Expand Down
1 change: 0 additions & 1 deletion FWCore/ParameterSet/examples/varParsingExample.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#! /usr/bin/env python3

from __future__ import print_function
from FWCore.ParameterSet.VarParsing import VarParsing
options = VarParsing ('python')
options.inputFiles = 'bob','peter'
Expand Down
2 changes: 0 additions & 2 deletions FWCore/ParameterSet/python/Config.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python3

### command line options helper
from __future__ import print_function
from __future__ import absolute_import
import os
from .Options import Options
options = Options()
Expand Down
1 change: 0 additions & 1 deletion FWCore/ParameterSet/python/MassReplace.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import FWCore.ParameterSet.Config as cms

class MassSearchReplaceAnyInputTagVisitor(object):
Expand Down
1 change: 0 additions & 1 deletion FWCore/ParameterSet/python/Mixins.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
from builtins import range, object
import inspect
from typing import Union
Expand Down
1 change: 0 additions & 1 deletion FWCore/ParameterSet/python/Modules.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import
from .Mixins import _ConfigureComponent, saveOrigin
from .Mixins import _Unlabelable, _Labelable
from .Mixins import _TypedParameterizable, _Parameterizable, PrintOptions, specialImportRegistry
Expand Down
1 change: 0 additions & 1 deletion FWCore/ParameterSet/python/OrderedSet.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
# The MIT License (MIT)
#
# Copyright (c) 19 March 2009 Created by Raymond Hettinger (MIT)
Expand Down
1 change: 0 additions & 1 deletion FWCore/ParameterSet/python/SequenceTypes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import
import sys

from builtins import range
Expand Down
1 change: 0 additions & 1 deletion FWCore/ParameterSet/python/SequenceVisitors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import
from .SequenceTypes import *
from .Modules import OutputModule, EDProducer, EDFilter, EDAnalyzer, Service, ESProducer, ESSource, _Module
from .Mixins import _Labelable
Expand Down
1 change: 0 additions & 1 deletion FWCore/ParameterSet/python/TreeCrawler.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
# This CMS code is based on previous work done by Toby Dickenson, as indiciated below
#
# for questions: [email protected]
Expand Down
1 change: 0 additions & 1 deletion FWCore/ParameterSet/python/Types.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import
from .Mixins import PrintOptions, _SimpleParameterTypeBase, _ParameterTypeBase, _Parameterizable, _ConfigureComponent, _Labelable, _TypedParameterizable, _Unlabelable, _modifyParametersFromDict
from .Mixins import _ValidatingParameterListBase, specialImportRegistry
from .Mixins import saveOrigin
Expand Down
1 change: 0 additions & 1 deletion FWCore/ParameterSet/python/VarParsing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import sys
import os
import re
Expand Down
1 change: 0 additions & 1 deletion FWCore/ParameterSet/python/test/MessWithGeometry_cfg.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import FWCore.ParameterSet.Config as cms

process = cms.Process("P")
Expand Down
1 change: 0 additions & 1 deletion FWCore/ParameterSet/scripts/edmConfigIncludeChecker
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#
# for questions: [email protected]

from __future__ import print_function
from builtins import object
import os.path
import sys
Expand Down
1 change: 0 additions & 1 deletion FWCore/ParameterSet/test/cmsconfig.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
#------------------------------------------------------------
#
#
Expand Down
1 change: 0 additions & 1 deletion FWCore/PythonUtilities/python/XML2Python.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
## Original version of code heavily based on recipe written by Wai Yip
## Tung, released under PSF license.
## http://code.activestate.com/recipes/534109/
Expand Down
1 change: 0 additions & 1 deletion FWCore/PythonUtilities/scripts/interactivePythonTest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
from __future__ import print_function
import sys
import os
import readline
Expand Down
1 change: 0 additions & 1 deletion FWCore/Services/scripts/edmTracerCompactLogViewer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
from __future__ import print_function
from builtins import range
from itertools import groupby
from operator import attrgetter,itemgetter
Expand Down
1 change: 0 additions & 1 deletion FWCore/Services/scripts/edmTracerLogToSimpleConfig.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
#==============================
#
# First argument is a log file from cmsRun
Expand Down
1 change: 0 additions & 1 deletion FWCore/Skeletons/python/cms.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
Author : Valentin Kuznetsov <[email protected]>
Description: CMS-related utils
"""
from __future__ import print_function

# system modules
from builtins import range
Expand Down
1 change: 0 additions & 1 deletion FWCore/Skeletons/python/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
Author : Valentin Kuznetsov <[email protected]>
Description:
"""
from __future__ import print_function

# system modules
import os
Expand Down
1 change: 0 additions & 1 deletion FWCore/Skeletons/python/pkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
Description: AbstractGenerator class provides basic functionality
to generate CMSSW class from given template
"""
from __future__ import print_function

# system modules
import os
Expand Down
1 change: 0 additions & 1 deletion FWCore/Skeletons/python/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
Author : Valentin Kuznetsov <[email protected]>
Description: Utilities module
"""
from __future__ import print_function

# system modules
from builtins import range
Expand Down
1 change: 0 additions & 1 deletion FWCore/Utilities/python/FileUtils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import os
import re
import pprint as pprint # for testing
Expand Down
1 change: 0 additions & 1 deletion IOMC/Input/test/hepmc2gen.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
#!/usr/bin/env cmsRun

## Original Author: Andrea Carlo Marini
Expand Down
1 change: 0 additions & 1 deletion IOMC/RandomEngine/python/RandomServiceHelper.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python


from __future__ import print_function
from FWCore.ParameterSet.Config import Service
import FWCore.ParameterSet.Types as CfgTypes

Expand Down
1 change: 0 additions & 1 deletion Utilities/ReleaseScripts/data/edmScanValgrind.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/env python
from __future__ import print_function
import sys

fileName = sys.argv[1]
Expand Down
1 change: 0 additions & 1 deletion Utilities/ReleaseScripts/python/cmsCodeRules/Formatter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3

from __future__ import print_function
import os, sys, string

from xml.parsers import expat
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
from builtins import range
__author__="Aurelija"
__date__ ="$2010-09-23 15.00.20$"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
__author__="Aurelija"
__date__ ="$2010-07-26 12.51.12$"

Expand Down
1 change: 0 additions & 1 deletion Utilities/ReleaseScripts/python/cmsCodeRules/showPage.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3

from __future__ import print_function
from builtins import range
__author__="Aurelija"
__date__ ="$2010-08-12 10.50.40$"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import
__author__="Aurelija"
__date__ ="$2010-08-09 14.23.54$"

Expand Down
1 change: 0 additions & 1 deletion Utilities/ReleaseScripts/scripts/MakeBuildSet
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#! /usr/bin/env python3
from __future__ import print_function
#pylint: disable-msg=W0403
"""
MakeBuildSet - utilizes dependency discovery mechanism for Partial Releases.
Expand Down
1 change: 0 additions & 1 deletion Utilities/ReleaseScripts/scripts/addOnTests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#! /usr/bin/env python3

from __future__ import print_function
from builtins import range
import os
import time
Expand Down
1 change: 0 additions & 1 deletion Utilities/ReleaseScripts/scripts/cmsCodeRulesChecker.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3

from __future__ import print_function
from builtins import range
__author__="Aurelija"
__date__ ="$2010-07-14 16.48.55$"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#! /usr/bin/env python3

from __future__ import print_function
import optparse
import os
import re
Expand Down
1 change: 0 additions & 1 deletion Utilities/ReleaseScripts/scripts/storeTreeInfo.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3

from __future__ import print_function
from builtins import range
import os, sys, stat
from operator import itemgetter
Expand Down
1 change: 0 additions & 1 deletion Utilities/ReleaseScripts/scripts/ws_sso_content_reader.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3
###Description: The tool reads cern web services behind SSO using user certificates
from __future__ import print_function
import os, urllib, urllib2, httplib, cookielib, sys, HTMLParser, re
from optparse import OptionParser

Expand Down
1 change: 0 additions & 1 deletion Utilities/StaticAnalyzers/scripts/callgraph.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#! /usr/bin/env python3
from __future__ import print_function
import networkx as nx
import re
import json
Expand Down
1 change: 0 additions & 1 deletion Utilities/StaticAnalyzers/scripts/class-composition.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#! /usr/bin/env python3
from __future__ import print_function
import networkx as nx
import re
stdcl = re.compile("^std::(.*)[^>]$")
Expand Down
1 change: 0 additions & 1 deletion Utilities/StaticAnalyzers/scripts/data-class-funcs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#! /usr/bin/env python3
from __future__ import print_function
import fileinput
import networkx as nx
import re
Expand Down
1 change: 0 additions & 1 deletion Utilities/StaticAnalyzers/scripts/edm-global-class.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#! /usr/bin/env python3
from __future__ import print_function
import fileinput
import networkx as nx
import re
Expand Down
1 change: 0 additions & 1 deletion Utilities/StaticAnalyzers/scripts/statics.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#! /usr/bin/env python3
from __future__ import print_function
import fileinput
import networkx as nx
from builtins import range
Expand Down
1 change: 0 additions & 1 deletion Utilities/StaticAnalyzers/scripts/symbols.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#! /usr/bin/env python3

from __future__ import print_function
import networkx as nx
import collections
import os
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#! /usr/bin/env python3


from __future__ import print_function
def manipulate_log(outdir,logfile_name,startevt):

import time
Expand Down
1 change: 0 additions & 1 deletion Validation/Performance/scripts/cmsTiming_parser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#! /usr/bin/env python3

from __future__ import print_function
from builtins import range
import sys, os
import time
Expand Down
1 change: 0 additions & 1 deletion Validation/Tools/examples/printConversionInfo.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#! /usr/bin/env python3

from __future__ import print_function
import ROOT
import sys
from DataFormats.FWLite import Events, Handle
Expand Down
1 change: 0 additions & 1 deletion Validation/Tools/python/GenObject.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
## Note: Please do not use or modify any data or functions with a
## leading underscore. If you "mess" with the internal structure,
## the classes may not function as intended.
Expand Down
1 change: 0 additions & 1 deletion Validation/Tools/scripts/diffTreeTool.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#! /usr/bin/env python3

from __future__ import print_function
from builtins import range
import optparse
import os
Expand Down
1 change: 0 additions & 1 deletion Validation/Tools/scripts/edmOneToOneComparison.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#! /usr/bin/env python3

from __future__ import print_function
if __name__ == "__main__":
import optparse
parser = optparse.OptionParser("usage: %prog [options] config.txt file1.root [file2.root]\nVisit https://twiki.cern.ch/twiki/bin/view/CMS/SWGuidePhysicsToolsEdmOneToOneComparison\nfor full documentation.")
Expand Down
1 change: 0 additions & 1 deletion Validation/Tools/scripts/runEdmFileComparison.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#! /usr/bin/env python3

from __future__ import print_function
import optparse
import subprocess
import pprint
Expand Down
1 change: 0 additions & 1 deletion Validation/Tools/scripts/simpleEdmComparison.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#! /usr/bin/env python3

from __future__ import print_function
from builtins import range
import inspect
import itertools
Expand Down
1 change: 0 additions & 1 deletion Validation/Tools/scripts/summarizeEdmComparisonLogfiles.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#! /usr/bin/env python3

from __future__ import print_function
import optparse
import os
from glob import glob
Expand Down
Loading