eric6/WebBrowser/Download/DownloadItem.py

changeset 8260
2161475d9639
parent 8227
349308e84eeb
child 8273
698ae46f40a4
--- a/eric6/WebBrowser/Download/DownloadItem.py	Wed Apr 21 19:40:50 2021 +0200
+++ b/eric6/WebBrowser/Download/DownloadItem.py	Thu Apr 22 18:02:47 2021 +0200
@@ -400,10 +400,11 @@
             return -1.0
         
         cSpeed = self.currentSpeed()
-        if cSpeed != 0:
-            timeRemaining = (self.bytesTotal() - self.bytesReceived()) / cSpeed
-        else:
-            timeRemaining = 1
+        timeRemaining = (
+            (self.bytesTotal() - self.bytesReceived()) / cSpeed
+            if cSpeed != 0 else
+            1
+        )
         
         # ETA should never be 0
         if timeRemaining == 0:

eric ide

mercurial