diff options
author | Brenda J. Butler <bjb@mojatatu.com> | 2017-10-31 19:28:35 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-11-01 03:04:47 +0100 |
commit | 6c26c3fbc3295ce71f5e03caccc9eeb7369123ca (patch) | |
tree | ea15f0084e827cf0d1fa159537cde468b49f02bb /tools/testing | |
parent | tc-testing: correction to docstring in get_unique_item (diff) | |
download | linux-6c26c3fbc3295ce71f5e03caccc9eeb7369123ca.tar.xz linux-6c26c3fbc3295ce71f5e03caccc9eeb7369123ca.zip |
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>
Diffstat (limited to 'tools/testing')
-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 6f99a4efe761..d935cbc34cc3 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: |