Преглед на файлове

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