未验证 提交 9796980c 编写于 作者: 张春乔 提交者: GitHub

[CodeStyle][UP012] Unnecessary call to encode as UTF-8 (#51994)

上级 0b008e0c
......@@ -46,6 +46,7 @@ select = [
"UP008",
"UP010",
"UP011",
"UP012",
"UP013",
"UP014",
"UP017",
......
......@@ -47,7 +47,7 @@ class TestNanInf(unittest.TestCase):
print(err)
# in python3, type(out+err) is 'bytes', need use encode
assert (out + err).find('There are NAN or INF'.encode()) != -1
assert (out + err).find(b'There are NAN or INF') != -1
def test_nan_inf_in_static_mode(self):
self._python_interp += " check_nan_inf_base.py"
......
......@@ -67,7 +67,7 @@ class Test_is_primitive(unittest.TestCase):
self.assertTrue(is_primitive(2))
self.assertTrue(is_primitive(2.1))
self.assertTrue(is_primitive("2.1.1"))
self.assertFalse(is_primitive("hello paddle".encode('UTF-8')))
self.assertFalse(is_primitive(b"hello paddle"))
self.assertFalse(is_primitive(1j))
self.assertTrue(is_primitive(True))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册