Skip to content

Commit

Permalink
Properly detect and compare Python version 3.10+ (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
hroncok committed Oct 30, 2020
1 parent 2aef902 commit 44d2d60
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions asciidoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
# Used by asciidocapi.py #
VERSION = '9.0.3' # See CHANGELOG file for version history.

MIN_PYTHON_VERSION = '3.5' # Require this version of Python or better.
MIN_PYTHON_VERSION = (3, 5) # Require this version of Python or better.

# ---------------------------------------------------------------------------
# Program constants.
Expand Down Expand Up @@ -4719,8 +4719,8 @@ def init(self, cmd):
directory.
cmd is the asciidoc command or asciidoc.py path.
"""
if float(sys.version[:3]) < float(MIN_PYTHON_VERSION):
message.stderr('FAILED: Python %s or better required' % MIN_PYTHON_VERSION)
if sys.version_info[:2] < MIN_PYTHON_VERSION:
message.stderr('FAILED: Python %d.%d or better required' % MIN_PYTHON_VERSION)
sys.exit(1)
if not os.path.exists(cmd):
message.stderr('FAILED: Missing asciidoc command: %s' % cmd)
Expand Down

0 comments on commit 44d2d60

Please sign in to comment.