Skip to content

Commit 4c614e0

Browse files
authored
[bp2.2] Use isinstance API instead of type API (#1069)
correct way to check datatype of variable is `isinstance` (cherry picked from commit a349921) Signed-off-by: Abhijeet Kasurde <[email protected]>
1 parent 13cd932 commit 4c614e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ansible_runner/utils/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ def open_fifo_write(path, data):
432432
'''
433433
os.mkfifo(path, stat.S_IRUSR | stat.S_IWUSR)
434434
# If the data is a string instead of bytes, convert it before writing the fifo
435-
if type(data) == str:
435+
if isinstance(data, string_types):
436436
data = data.encode()
437437
threading.Thread(target=lambda p, d: open(p, 'wb').write(d),
438438
args=(path, data)).start()

0 commit comments

Comments
 (0)