From d7dd07f2ed14ab45591d9a1a4873a9ad1e355b9c Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Mon, 9 May 2022 19:02:02 +0530 Subject: [PATCH] [bp2.2] Use isinstance API instead of type API correct way to check datatype of variable is `isinstance` (cherry picked from commit a349921448f84dc507abbd87aca163291f2c3bdc) Signed-off-by: Abhijeet Kasurde --- ansible_runner/utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible_runner/utils/__init__.py b/ansible_runner/utils/__init__.py index c0b921aa0..5474183f9 100644 --- a/ansible_runner/utils/__init__.py +++ b/ansible_runner/utils/__init__.py @@ -432,7 +432,7 @@ def open_fifo_write(path, data): ''' os.mkfifo(path, stat.S_IRUSR | stat.S_IWUSR) # If the data is a string instead of bytes, convert it before writing the fifo - if type(data) == str: + if isinstance(data, string_types): data = data.encode() threading.Thread(target=lambda p, d: open(p, 'wb').write(d), args=(path, data)).start()