From 11a8f911affe10bacce41ad3474a28aff3417ec3 Mon Sep 17 00:00:00 2001 From: Brandon Palm Date: Mon, 22 Feb 2016 16:20:30 -0600 Subject: Use instanceof instead of type Adjusted conditional statements to use instanceof when comparing variables. Instanceof supports inheritance type checking better than type. Change-Id: I4ee0004934dc2322d43ef07e797a6811e39a812c Closes-Bug: 1548530 --- openstackclient/tests/test_shell.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'openstackclient/tests') diff --git a/openstackclient/tests/test_shell.py b/openstackclient/tests/test_shell.py index c4546d89..80b18161 100644 --- a/openstackclient/tests/test_shell.py +++ b/openstackclient/tests/test_shell.py @@ -317,7 +317,7 @@ class TestShellOptions(TestShell): if not test_opts[opt][1]: continue key = opt2attr(opt) - if type(test_opts[opt][0]) is str: + if isinstance(test_opts[opt][0], str): cmd = opt + " " + test_opts[opt][0] else: cmd = opt @@ -331,7 +331,7 @@ class TestShellOptions(TestShell): if not test_opts[opt][1]: continue key = opt2attr(opt) - if type(test_opts[opt][0]) is str: + if isinstance(test_opts[opt][0], str): cmd = opt + " " + test_opts[opt][0] else: cmd = opt -- cgit v1.2.1