Bug 844797 - Avoid UnboundLocalError on dumpDir in checkForCrashes; r=edmorley
authorGeoff Brown <gbrown@mozilla.com>
Tue, 26 Feb 2013 07:19:58 -0700
changeset 123017 bf6ef4772884397681a98b82a99004afa7982e14
parent 123016 5228ec314dc99a425d9007f90c889b263bc58f0f
child 123018 9cbb040ed6da24a209666df1a96ccb6c1d1a41bf
push id24372
push useremorley@mozilla.com
push dateWed, 27 Feb 2013 13:22:59 +0000
treeherdermozilla-central@0a91da5f5eab [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedmorley
bugs844797
milestone22.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 844797 - Avoid UnboundLocalError on dumpDir in checkForCrashes; r=edmorley
build/mobile/remoteautomation.py
--- a/build/mobile/remoteautomation.py
+++ b/build/mobile/remoteautomation.py
@@ -118,25 +118,25 @@ class RemoteAutomation(Automation):
         return found_exception
 
     def checkForCrashes(self, directory, symbolsPath):
         logcat = self._devicemanager.getLogcat(filterOutRegexps=fennecLogcatFilters)
         javaException = self.checkForJavaException(logcat)
         if javaException:
             return True
         try:
+            dumpDir = tempfile.mkdtemp()
             remoteCrashDir = self._remoteProfile + '/minidumps/'
             if not self._devicemanager.dirExists(remoteCrashDir):
                 # As of this writing, the minidumps directory is automatically
                 # created when fennec (first) starts, so its lack of presence
                 # is a hint that something went wrong.
                 print "Automation Error: No crash directory (%s) found on remote device" % remoteCrashDir
                 # Whilst no crash was found, the run should still display as a failure
                 return True
-            dumpDir = tempfile.mkdtemp()
             self._devicemanager.getDirectory(remoteCrashDir, dumpDir)
             crashed = automationutils.checkForCrashes(dumpDir, symbolsPath,
                                             self.lastTestSeen)
         finally:
             try:
                 shutil.rmtree(dumpDir)
             except:
                 print "WARNING: unable to remove directory: %s" % dumpDir