From d72a17d03b7ef2fbd48caa814579f4e33c8efbf6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 20 Dec 2020 12:33:41 +0530 Subject: [PATCH] More stupid PyQt enums --- src/calibre/gui2/store/web_store.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/store/web_store.py b/src/calibre/gui2/store/web_store.py index b158425858..23707299b5 100644 --- a/src/calibre/gui2/store/web_store.py +++ b/src/calibre/gui2/store/web_store.py @@ -10,7 +10,7 @@ from PyQt5.Qt import ( QApplication, QHBoxLayout, QIcon, QLabel, QProgressBar, QPushButton, QSize, QUrl, QVBoxLayout, QWidget, pyqtSignal ) -from PyQt5.QtWebEngineWidgets import QWebEngineProfile, QWebEngineView +from PyQt5.QtWebEngineWidgets import QWebEngineProfile, QWebEngineView, QWebEngineDownloadItem from calibre import random_user_agent, url_slash_cleaner from calibre.constants import STORE_DIALOG_APP_UID, cache_dir, islinux, iswindows @@ -181,7 +181,7 @@ class Main(MainWindow): download_item = self.download_data.pop(download_id) path = download_item.path() fname = os.path.basename(path) - if download_item.state() == download_item.DownloadInterrupted: + if download_item.state() == QWebEngineDownloadItem.DownloadState.DownloadInterrupted: error_dialog(self, _('Download failed'), _( 'Download of {0} failed with error: {1}').format(fname, download_item.interruptReasonString()), show=True) return