diff options
author | Brenda J. Butler <bjb@mojatatu.com> | 2017-10-31 14:28:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-11-01 11:04:47 +0900 |
commit | 6c26c3fbc3295ce71f5e03caccc9eeb7369123ca (patch) | |
tree | ea15f0084e827cf0d1fa159537cde468b49f02bb | |
parent | 7ae677fb85f46c6b1c0545a0558c507ab940d7c4 (diff) | |
download | op-kernel-dev-6c26c3fbc3295ce71f5e03caccc9eeb7369123ca.zip op-kernel-dev-6c26c3fbc3295ce71f5e03caccc9eeb7369123ca.tar.gz |
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>
-rw-r--r-- | tools/testing/selftests/tc-testing/tdc_helper.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/tc-testing/tdc_helper.py b/tools/testing/selftests/tc-testing/tdc_helper.py index 6f99a4e..d935cbc 100644 --- a/tools/testing/selftests/tc-testing/tdc_helper.py +++ b/tools/testing/selftests/tc-testing/tdc_helper.py @@ -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: |