diff --git a/tools/task_plots/plot_tasks.py b/tools/task_plots/plot_tasks.py
index 72d3869d10efcf685791b4dcb4923896527f177f..56b2144c652f3799a673d27bd03fc66768162424 100755
--- a/tools/task_plots/plot_tasks.py
+++ b/tools/task_plots/plot_tasks.py
@@ -442,10 +442,9 @@ for rank in ranks:
             toc = int(data[line, toccol]) / CPU_CLOCK
             tasks[thread][-1]["tic"] = tic
             tasks[thread][-1]["toc"] = toc
-            if (                "fof" in tasktype):
+            if ("fof" in tasktype):
                 tasks[thread][-1]["colour"] = TASKCOLOURS[tasktype]
-
-            else if(
+            elif(
                     "self" in tasktype
                     or "pair" in tasktype
                     or "recv" in tasktype