From: duplo Date: Fri, 21 May 2010 12:52:23 +0000 (+0000) Subject: Attempt to fix WindowsError related bug. X-Git-Tag: 2.5.0~137 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=264df59535958b2180719f01ef29cf655839b5c6;p=bertos.git Attempt to fix WindowsError related bug. NOTE: this modification need to be tested on Windows. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3780 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/BFinalPage.py b/wizard/BFinalPage.py index ecfbf63a..1285850a 100644 --- a/wizard/BFinalPage.py +++ b/wizard/BFinalPage.py @@ -59,7 +59,14 @@ class BFinalPage(BWizardPage): """ try: QApplication.instance().setOverrideCursor(Qt.WaitCursor) - self.project.createBertosProject() + try: + # This operation can throw WindowsError, if the directory is + # locked. + self.project.createBertosProject() + except OSError, e: + QMessageBox.critical(self, self.tr("Error removing destination directory"), self.tr("Close all the application using this directory and retry.")) + self.wizard().back() + return finally: QApplication.instance().restoreOverrideCursor() self._plugin_dict = {}