提交 6c26c3fb 编写于 作者: B Brenda J. Butler 提交者: David S. Miller

tc-testing: better check if thing is list

Check if tcase[k] is an instance of a list (is or is derived from list)
instead of checking if it is a list.

This will be useful if the data structures change to be something
that implements list, instead of being an actual list.  In that
case, this code will not have to change.
Signed-off-by: NBrenda J. Butler <bjb@mojatatu.com>
Acked-by: NLucas Bates <lucasb@mojatatu.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 7ae677fb
......@@ -57,7 +57,7 @@ def print_sll(items):
def print_test_case(tcase):
""" Pretty-printing of a given test case. """
for k in tcase.keys():
if (type(tcase[k]) == list):
if (isinstance(tcase[k], list)):
print(k + ":")
print_list(tcase[k])
else:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册