Skip to content

Commit

Permalink
Fix compare Python version number bug
Browse files Browse the repository at this point in the history
Should compare number not string, "9" > "10".
  • Loading branch information
xxyzz committed Jan 8, 2024
1 parent 7fbb131 commit 832cf9e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from calibre.customize import InterfaceActionBase

VERSION = (3, 30, 0)
VERSION = (3, 30, 1)


class WordDumbDumb(InterfaceActionBase):
Expand Down
4 changes: 3 additions & 1 deletion deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ def which_python() -> tuple[str, str]:
py_v = r.stdout.decode().strip()
else:
py_v = ".".join(platform.python_version_tuple()[:2])
if tuple(py_v.split(".")) < platform.python_version_tuple()[:2]:
if tuple(map(int, py_v.split("."))) < tuple(
map(int, platform.python_version_tuple()[:2])
):
raise Exception("OutdatedPython")
return py, py_v

Expand Down

0 comments on commit 832cf9e

Please sign in to comment.