From 7df47ad499803e6c91cd5227d80a8d79afe758c5 Mon Sep 17 00:00:00 2001 From: Dario Mapelli Date: Tue, 8 Jun 2021 16:04:15 +0200 Subject: [PATCH] [py2py3] fix unittests from #10289 - src --- src/python/WMCore/Services/DBS/DBS3Reader.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/python/WMCore/Services/DBS/DBS3Reader.py b/src/python/WMCore/Services/DBS/DBS3Reader.py index ca55f44e3f9..ea792611b97 100644 --- a/src/python/WMCore/Services/DBS/DBS3Reader.py +++ b/src/python/WMCore/Services/DBS/DBS3Reader.py @@ -21,6 +21,7 @@ from retry import retry from Utils.IteratorTools import grouper +from Utils.PythonVersion import PY2 from WMCore.Services.DBS.DBSErrors import DBSReaderError, formatEx3 @@ -42,7 +43,7 @@ def remapDBS3Keys(data, stringify=False, **others): 'block_name': 'BlockName', 'lumi_section_num': 'LumiSectionNumber'} mapping.update(others) - formatFunc = lambda x: encodeUnicodeToBytes(x) if stringify else x + formatFunc = lambda x: encodeUnicodeToBytes(x) if PY2 and stringify else x for name, newname in viewitems(mapping): if name in data: data[newname] = formatFunc(data[name])