Browse Source

graph-build-time: support python3

This patch is the result of 2to3.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Tested-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Vivien Didelot 11 years ago
parent
commit
7cf527426f
1 changed files with 3 additions and 3 deletions
  1. 3 3
      support/scripts/graph-build-time

+ 3 - 3
support/scripts/graph-build-time

@@ -80,16 +80,16 @@ class Package:
             self.steps_start[step] = time
             self.steps_start[step] = time
         else:
         else:
             self.steps_end[step] = time
             self.steps_end[step] = time
-        if self.steps_start.has_key(step) and self.steps_end.has_key(step):
+        if step in self.steps_start and step in self.steps_end:
             self.steps_duration[step] = self.steps_end[step] - self.steps_start[step]
             self.steps_duration[step] = self.steps_end[step] - self.steps_start[step]
 
 
     def get_duration(self, step=None):
     def get_duration(self, step=None):
         if step is None:
         if step is None:
             duration = 0
             duration = 0
-            for step in self.steps_duration.keys():
+            for step in list(self.steps_duration.keys()):
                 duration += self.steps_duration[step]
                 duration += self.steps_duration[step]
             return duration
             return duration
-        if self.steps_duration.has_key(step):
+        if step in self.steps_duration:
             return self.steps_duration[step]
             return self.steps_duration[step]
         return 0
         return 0