diff --git a/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py b/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py index ce07df7c8ad..cb9a50cfd08 100644 --- a/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py +++ b/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py @@ -504,12 +504,14 @@ class DeviceManagerADB(DeviceManager): if directive == "os" or directive == "all": ret["os"] = self.shellCheckOutput(["getprop", "ro.build.display.id"]) if directive == "uptime" or directive == "all": - utime = self.shellCheckOutput(["uptime"]) - if (not utime): + uptime = self.shellCheckOutput(["uptime"]) + if not uptime: raise DMError("error getting uptime") - m = re.match("up time: ((\d+) days, )*(\d{2}):(\d{2}):(\d{2})", utime) - ret["uptime"] = "%d days %d hours %d minutes %d seconds" % tuple( - [int(g or 0) for g in m.groups()[1:]]) + m = re.match("up time: ((\d+) days, )*(\d{2}):(\d{2}):(\d{2})", uptime) + if m: + uptime = "%d days %d hours %d minutes %d seconds" % tuple( + [int(g or 0) for g in m.groups()[1:]]) + ret["uptime"] = uptime if directive == "process" or directive == "all": ret["process"] = self.shellCheckOutput(["ps"]) if directive == "systime" or directive == "all":