From 82fecc9e0dcf0c077e01a16f156e5cf1908467d1 Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Tue, 22 Jun 2021 21:46:34 -0400 Subject: [PATCH] Fix ThrobbingButton init with Python 3.10 It is no longer possible to pass floats to C functions where ints are expected, so explicitly convert to int in this case. --- src/calibre/gui2/throbber.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/throbber.py b/src/calibre/gui2/throbber.py index c0cc280267..b0ede83650 100644 --- a/src/calibre/gui2/throbber.py +++ b/src/calibre/gui2/throbber.py @@ -33,7 +33,7 @@ class ThrobbingButton(QToolButton): QToolButton.setIcon(self, QIcon(I('donate.png'))) self.setText('\xa0') self.animation = QPropertyAnimation(self, b'icon_size', self) - self.animation.setDuration(60/72.*1000) + self.animation.setDuration(int(60/72.*1000)) self.animation.setLoopCount(4) self.animation.valueChanged.connect(self.value_changed) self.setCursor(Qt.CursorShape.PointingHandCursor)