Skip to content

Commit

Permalink
[bp2.2] Use isinstance API instead of type API (#1069)
Browse files Browse the repository at this point in the history
correct way to check datatype of variable is `isinstance`

(cherry picked from commit a349921)

Signed-off-by: Abhijeet Kasurde <akasurde@redhddat.com>
  • Loading branch information
Akasurde committed May 9, 2022
1 parent 13cd932 commit 4c614e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ansible_runner/utils/__init__.py
Expand Up @@ -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()
Expand Down

0 comments on commit 4c614e0

Please sign in to comment.