eric6/WebBrowser/Download/DownloadItem.py

changeset 8227
349308e84eeb
parent 8218
7c09585bd960
child 8260
2161475d9639
diff -r 6dc5b1db7bdc -r 349308e84eeb eric6/WebBrowser/Download/DownloadItem.py
--- a/eric6/WebBrowser/Download/DownloadItem.py	Mon Apr 12 18:25:52 2021 +0200
+++ b/eric6/WebBrowser/Download/DownloadItem.py	Mon Apr 12 19:05:23 2021 +0200
@@ -245,15 +245,17 @@
         
         # check file path for saving
         saveDirPath = QFileInfo(self.__fileName).dir()
-        if not saveDirPath.exists():
-            if not saveDirPath.mkpath(saveDirPath.absolutePath()):
-                self.progressBar.setVisible(False)
-                self.on_stopButton_clicked()
-                self.infoLabel.setText(self.tr(
-                    "Download directory ({0}) couldn't be created.")
-                    .format(saveDirPath.absolutePath()))
-                self.__setDateTime()
-                return
+        if (
+            not saveDirPath.exists() and
+            not saveDirPath.mkpath(saveDirPath.absolutePath())
+        ):
+            self.progressBar.setVisible(False)
+            self.on_stopButton_clicked()
+            self.infoLabel.setText(self.tr(
+                "Download directory ({0}) couldn't be created.")
+                .format(saveDirPath.absolutePath()))
+            self.__setDateTime()
+            return
         
         self.filenameLabel.setText(QFileInfo(self.__fileName).fileName())
     

eric ide

mercurial