From 757c492c9786716565af439a3c818fff97f0cef5 Mon Sep 17 00:00:00 2001 From: Shahzad Malik Muzaffar Date: Mon, 23 Sep 2024 10:08:41 +0200 Subject: [PATCH] [HLT] [PY312] String formating to fix SyntaxWarning --- .../Configuration/python/Tools/confdb.py | 24 +++++++++---------- HLTrigger/Tools/python/rrapi.py | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/HLTrigger/Configuration/python/Tools/confdb.py b/HLTrigger/Configuration/python/Tools/confdb.py index ecbd0d47d83eb..5baca70ccf561 100644 --- a/HLTrigger/Configuration/python/Tools/confdb.py +++ b/HLTrigger/Configuration/python/Tools/confdb.py @@ -473,24 +473,24 @@ def overrideOutput(self): ) self.data = re.sub("""\ -\\b(process\.)?hltOutput(\w+) *= *cms\.OutputModule\( *['"](EvFOutputModule|GlobalEvFOutputModule)['"] *, - use_compression = cms.untracked.bool\( (True|False) \), - compression_algorithm = cms.untracked.string\( ['"](.+?)['"] \), - compression_level = cms.untracked.int32\( (-?\d+) \), - lumiSection_interval = cms.untracked.int32\( (-?\d+) \), +\\b(process\\.)?hltOutput(\\w+) *= *cms\\.OutputModule\\( *['"](EvFOutputModule|GlobalEvFOutputModule)['"] *, + use_compression = cms.untracked.bool\\( (True|False) \\), + compression_algorithm = cms.untracked.string\\( ['"](.+?)['"] \\), + compression_level = cms.untracked.int32\\( (-?\\d+) \\), + lumiSection_interval = cms.untracked.int32\\( (-?\\d+) \\), (.+?), - psetMap = cms.untracked.InputTag\( ['"]hltPSetMap['"] \) + psetMap = cms.untracked.InputTag\\( ['"]hltPSetMap['"] \\) ""","""\ -%(process)s.hltOutput\g<2> = cms.OutputModule( "PoolOutputModule", - fileName = cms.untracked.string( "output\g<2>.root" ), - compressionAlgorithm = cms.untracked.string( "\g<5>" ), - compressionLevel = cms.untracked.int32( \g<6> ), +%(process)s.hltOutput\\g<2> = cms.OutputModule( "PoolOutputModule", + fileName = cms.untracked.string( "output\\g<2>.root" ), + compressionAlgorithm = cms.untracked.string( "\\g<5>" ), + compressionLevel = cms.untracked.int32( \\g<6> ), fastCloning = cms.untracked.bool( False ), dataset = cms.untracked.PSet( filterName = cms.untracked.string( "" ), dataTier = cms.untracked.string( "RAW" ) ), -\g<8> +\\g<8> """, self.data, 0, re.DOTALL) if not self.config.fragment and self.config.output == 'minimal': @@ -542,7 +542,7 @@ def addEras(self): return from Configuration.StandardSequences.Eras import eras erasSplit = self.config.eras.split(',') - self.data = re.sub(r'process = cms.Process\( *"\w+"', '\n'.join(eras.pythonCfgLines[era] for era in erasSplit)+'\n\g<0>, '+', '.join(era for era in erasSplit), self.data) + self.data = re.sub(r'process = cms.Process\( *"\w+"', '\n'.join(eras.pythonCfgLines[era] for era in erasSplit)+'\n\\g<0>, '+', '.join(era for era in erasSplit), self.data) # select specific Eras def loadSetupCff(self): diff --git a/HLTrigger/Tools/python/rrapi.py b/HLTrigger/Tools/python/rrapi.py index 35de4b71ff0dc..b26e28209a58d 100644 --- a/HLTrigger/Tools/python/rrapi.py +++ b/HLTrigger/Tools/python/rrapi.py @@ -27,7 +27,7 @@ def __init__(self, resp): m = re.search("
(.*)", line)
                     if m != None:
                         self.stack = m.group(1)
-                        m = re.search("^.+\.([^\.]+: .*)$", self.stack)
+                        m = re.search("^.+\\.([^\\.]+: .*)$", self.stack)
                         if m != None:
                             self.message = m.group(1)
                         else: