瀏覽代碼

tools: do not pop an element when the stack is empty

This fixes a Python error in starpu_trace_state_stats.py when the stack
of states is actually empty.
Samuel Pitoiset 9 年之前
父節點
當前提交
e0705a6070
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      tools/starpu_trace_state_stats.py

+ 2 - 1
tools/starpu_trace_state_stats.py

@@ -91,7 +91,8 @@ class Worker():
                     if next_event._type == "SetState":
                         break
             elif next_event._type == "PopState":
-                curr_event = self._stack.pop()
+		if not len(self._stack) == 0:
+                    curr_event = self._stack.pop()
 
             # Compute duration with the next event.
             a = curr_event._start_time