Commits

riaan  committed edc4ea2

Improved handling of invalid working directory.

  • Participants
  • Parent commits 53111e2
  • Branches Boa_0-4-0_pre

Comments (0)

Files changed (1)

             sys.stderr = Utils.ErrorLoggerPF()
             sys.stdout = Utils.OutputLoggerPF()
 
+        if Preferences.exWorkingDirectory:
+            try:
+                os.chdir(Preferences.exWorkingDirectory)
+            except OSError, err:
+                startupErrors.append('Could not set working directory from '\
+                      'Preferences.exWorkingDirectory :')
+                startupErrors.append(str(err))
+
         if startupErrors:
             for error in startupErrors:
                 wxLogError(error)
             EVT_MENU(self.tbicon, self.TBMENU_CLOSE, self.OnTaskBarClose)
             EVT_MENU(self.tbicon, self.TBMENU_ABOUT, self.OnTaskBarAbout)
 
-        if Preferences.exWorkingDirectory:
-            os.chdir(Preferences.exWorkingDirectory)
-
         editor.assureRefreshed()
 
         return true