Skip to content

Commit

Permalink
[py2py3] fix unittests from dmwm#10289 - src
Browse files Browse the repository at this point in the history
  • Loading branch information
mapellidario committed Jun 8, 2021
1 parent 0917dbe commit 7df47ad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/python/WMCore/Services/DBS/DBS3Reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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])
Expand Down

0 comments on commit 7df47ad

Please sign in to comment.