1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-13 09:46:25 +00:00

add Python 3.12 support

This commit is contained in:
Alex Xu
2024-08-28 14:25:14 -07:00
parent d22794555f
commit 16dd034af4
3 changed files with 10 additions and 11 deletions

View File

@@ -31,7 +31,7 @@ from PySide6.QtCore import Qt
from xml.sax.saxutils import escape
from psutil import Process
from copy import copy
from distutils.version import StrictVersion
from packaging.version import Version
from raven import Client
from tempfile import gettempdir
@@ -146,9 +146,9 @@ class VersionThread(QtCore.QThread):
latest_version = json_parser["tag_name"]
latest_version = re.sub(r'^v', "", latest_version)
if ("b" not in __version__ and StrictVersion(latest_version) > StrictVersion(__version__)) \
if ("b" not in __version__ and Version(latest_version) > Version(__version__)) \
or ("b" in __version__
and StrictVersion(latest_version) >= StrictVersion(re.sub(r'b.*', '', __version__))):
and Version(latest_version) >= Version(re.sub(r'b.*', '', __version__))):
MW.addMessage.emit('<a href="' + html_url + '"><b>The new version is available!</b></a>', 'warning',
False)
except Exception:
@@ -851,7 +851,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
for line in versionCheck.stdout.splitlines():
if 'Amazon kindlegen' in line:
versionCheck = line.split('V')[1].split(' ')[0]
if StrictVersion(versionCheck) < StrictVersion('2.9'):
if Version(versionCheck) < Version('2.9'):
self.addMessage('Your <a href="https://www.amazon.com/b?node=23496309011">KindleGen</a>'
' is outdated! MOBI conversion might fail.', 'warning')
break