Be explicit that a code path is just for py2

Change-Id: I7d0345a712f71e76034910fa7bb2bbaf42b4d2ff
This commit is contained in:
Tim Burke 2019-05-17 10:30:21 -07:00
parent 506279235d
commit ad034023f3

View File

@ -1946,7 +1946,8 @@ class TestFile(Base):
if len(key) > j:
key = key[:j]
if isinstance(val, bytes):
# NB: we'll likely write object metadata that's *not* UTF-8
if six.PY2:
val = val[:j]
else:
val = val.encode('utf8')[:j].decode(