bytes() is a builtin in python2.6+

This commit is contained in:
Anthony Sottile 2018-06-03 11:54:36 -07:00
parent d609b635f4
commit 3d0717813a
1 changed files with 3 additions and 3 deletions

View File

@ -546,9 +546,9 @@ class TestAssert_reprcompare(object):
# issue 429 # issue 429
left = "e" left = "e"
right = "\xc3\xa9" right = "\xc3\xa9"
if not isinstance(left, py.builtin.bytes): if not isinstance(left, bytes):
left = py.builtin.bytes(left, "utf-8") left = bytes(left, "utf-8")
right = py.builtin.bytes(right, "utf-8") right = bytes(right, "utf-8")
expl = callequal(left, right) expl = callequal(left, right)
for line in expl: for line in expl:
assert isinstance(line, py.builtin.text) assert isinstance(line, py.builtin.text)