Skip to content

Commit d0acd55

Browse files
committed
Fixing flake8 errors.
1 parent f3b7518 commit d0acd55

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/test_pytypes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def test_pybind11_str_raw_str():
254254
valid_orig = u"DZ"
255255
valid_utf8 = valid_orig.encode("utf-8")
256256
valid_cvt = cvt(valid_utf8)
257-
assert type(valid_cvt) == type(u"") # Py2 unicode, Py3 str, flake8 compatible
257+
assert type(valid_cvt) is unicode if pytest.PY2 else str # noqa: F821
258258
if pytest.PY2:
259259
assert valid_cvt == valid_orig
260260
else:
@@ -267,7 +267,7 @@ def test_pybind11_str_raw_str():
267267
assert "invalid start byte" in str(excinfo)
268268
else:
269269
malformed_cvt = cvt(malformed_utf8)
270-
assert type(valid_cvt) == type(u"")
270+
assert type(malformed_cvt) is unicode if pytest.PY2 else str # noqa: F821
271271
assert malformed_cvt == u"b'\\x80'"
272272

273273

0 commit comments

Comments
 (0)