graph-build-time: support python3
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Mon, 23 Jun 2014 14:23:37 +0000 (10:23 -0400)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 29 Jun 2014 08:44:41 +0000 (10:44 +0200)
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>
support/scripts/graph-build-time

index 8ef065f1276ff2d8b7a5c2b8336c947813d01653..524c30d478b3f7dcc44c0f875cb034e0c0f8d62a 100755 (executable)
@@ -80,16 +80,16 @@ class Package:
             self.steps_start[step] = time
         else:
             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]
 
     def get_duration(self, step=None):
         if step is None:
             duration = 0
-            for step in self.steps_duration.keys():
+            for step in list(self.steps_duration.keys()):
                 duration += self.steps_duration[step]
             return duration
-        if self.steps_duration.has_key(step):
+        if step in self.steps_duration:
             return self.steps_duration[step]
         return 0