Skip to content

Commit

Permalink
do not compare types, use isinstance
Browse files Browse the repository at this point in the history
  • Loading branch information
jelly authored and tomasmatus committed Aug 21, 2023
1 parent fddb66c commit d0f8dcd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions run-queue
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,12 @@ def main():
logging.info("All queues are empty")
return 1

if type(cmd) is list:
if isinstance(cmd, list):
cmd_str = ' '.join(cmd)
else:
cmd_str = cmd
logging.info("Consuming message with command: %s", cmd_str)
p = subprocess.Popen(cmd, shell=type(cmd) is str)
p = subprocess.Popen(cmd, shell=isinstance(cmd, str))
while p.poll() is None:
q.connection.process_data_events()
time.sleep(3)
Expand Down

0 comments on commit d0f8dcd

Please sign in to comment.