diff options
author | Miro HronĨok <miro@hroncok.cz> | 2020-10-30 15:10:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-30 10:10:35 -0400 |
commit | 44d2d6095246124c024230f89c1029794491839f (patch) | |
tree | 362d37cfadeb02759d81cb29ebedc415a36e0b30 | |
parent | 2aef9025a68b6982ddd47c2add63efe5eca4effd (diff) | |
download | asciidoc-py3-44d2d6095246124c024230f89c1029794491839f.tar.gz |
Properly detect and compare Python version 3.10+ (#151)
-rwxr-xr-x | asciidoc.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/asciidoc.py b/asciidoc.py index f960e7d..42868c4 100755 --- a/asciidoc.py +++ b/asciidoc.py @@ -35,7 +35,7 @@ from collections import OrderedDict # 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. @@ -4719,8 +4719,8 @@ class Config: 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) |