From 264df59535958b2180719f01ef29cf655839b5c6 Mon Sep 17 00:00:00 2001 From: duplo Date: Fri, 21 May 2010 12:52:23 +0000 Subject: [PATCH] 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 --- wizard/BFinalPage.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 = {} -- 2.25.1