提交 47561c34 编写于 作者: M minqiyang

Fix python2 CI issues

上级 a3539845
...@@ -320,9 +320,8 @@ class Executor(object): ...@@ -320,9 +320,8 @@ class Executor(object):
# append fetch_operators # append fetch_operators
if not has_fetch_operators(global_block, fetch_list, fetch_var_name): if not has_fetch_operators(global_block, fetch_list, fetch_var_name):
for i, var in enumerate(fetch_list): for i, var in enumerate(fetch_list):
assert isinstance(var, Variable) or isinstance( assert isinstance(var, Variable) or isinstance(var, str), (
var, six.text_type), ("Wrong type for fetch_list[%s]: %s" % "Wrong type for fetch_list[%s]: %s" % (i, type(var)))
(i, type(var)))
global_block.append_op( global_block.append_op(
type='fetch', type='fetch',
inputs={'X': [var]}, inputs={'X': [var]},
......
...@@ -37,7 +37,7 @@ class TestLoDRankTable(unittest.TestCase): ...@@ -37,7 +37,7 @@ class TestLoDRankTable(unittest.TestCase):
exe.run(scope=scope, feed={'x': tensor}) exe.run(scope=scope, feed={'x': tensor})
var = scope.find_var(rank_table.name) var = scope.find_var(rank_table.name)
table = var.get_lod_rank_table() table = var.get_lod_rank_table()
self.assertEqual([(0, 5), (1, 1), (2, 1)], six.iteritems(table)) self.assertEqual([(0, 5), (1, 1), (2, 1)], list(six.iteritems(table)))
if __name__ == '__main__': if __name__ == '__main__':
......
...@@ -38,7 +38,7 @@ class TestNumpyArray(unittest.TestCase): ...@@ -38,7 +38,7 @@ class TestNumpyArray(unittest.TestCase):
x = np.array(l, np.int32) x = np.array(l, np.int32)
reader = paddle.reader.creator.np_array(x) reader = paddle.reader.creator.np_array(x)
for idx, e in enumerate(reader()): for idx, e in enumerate(reader()):
six.assertCountEqual(e, l[idx]) six.assertCountEqual(self, e, l[idx])
class TestTextFile(unittest.TestCase): class TestTextFile(unittest.TestCase):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册