瀏覽代碼

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: Brenda J. Butler <bjb@mojatatu.com>
Acked-by: Lucas Bates <lucasb@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Brenda J. Butler 8 年之前
父節點
當前提交
6c26c3fbc3
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      tools/testing/selftests/tc-testing/tdc_helper.py

+ 1 - 1
tools/testing/selftests/tc-testing/tdc_helper.py

@@ -57,7 +57,7 @@ def print_sll(items):
 def print_test_case(tcase):
 def print_test_case(tcase):
     """ Pretty-printing of a given test case. """
     """ Pretty-printing of a given test case. """
     for k in tcase.keys():
     for k in tcase.keys():
-        if (type(tcase[k]) == list):
+        if (isinstance(tcase[k], list)):
             print(k + ":")
             print(k + ":")
             print_list(tcase[k])
             print_list(tcase[k])
         else:
         else: