#4 Properly detect and compare Python version 3.10+
Closed 3 years ago by jridky. Opened 3 years ago by churchyard.
rpms/ churchyard/asciidoc python3.10  into  master

@@ -0,0 +1,36 @@ 

+ From e1e8f96b6065521e446fc118516fe928c75cd22b Mon Sep 17 00:00:00 2001

+ From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>

+ Date: Fri, 30 Oct 2020 12:18:20 +0100

+ Subject: [PATCH] Properly detect and compare Python version 3.10+

+ 

+ ---

+  asciidoc.py | 6 +++---

+  1 file changed, 3 insertions(+), 3 deletions(-)

+ 

+ diff --git a/asciidoc.py b/asciidoc.py

+ index 14641e9..76a16c3 100755

+ --- a/asciidoc.py

+ +++ b/asciidoc.py

+ @@ -35,7 +35,7 @@ from collections import OrderedDict

+  # Used by asciidocapi.py #

+  VERSION = '9.0.2'           # 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)

+ -- 

+ 2.29.2

+ 

file modified
+10 -1
@@ -1,11 +1,16 @@ 

  Name:           asciidoc

  Version:        9.0.2

- Release:        1%{?dist}

+ Release:        2%{?dist}

  Summary:        Text based document generation

  

  License:        GPL+ and GPLv2+

  URL:            http://asciidoc.org

  Source0:        https://github.com/%{name}/asciidoc-py3/archive/%{version}/%{name}-py3-%{version}.tar.gz

+ 

+ # Properly detect and compare Python version 3.10+

+ # https://github.com/asciidoc/asciidoc-py3/pull/151

+ Patch1:         asciidoc-python3.10.patch

+ 

  BuildArch:      noarch

  

  BuildRequires:  python3-devel
@@ -154,6 +159,10 @@ 

  %{_sysconfdir}/asciidoc/filters/music/*.py

  

  %changelog

+ * Fri Oct 30 2020 Miro Hrončok <mhroncok@redhat.com> - 9.0.2-2

+ - Properly detect and compare Python version 3.10+

+ - Fixes: rhbz#1889725

+ 

  * Wed Oct 14 2020 Fabian Affolter <mail@fabian-affolter.ch> - 9.0.2-1

  - Remove patches

  - Remove Vim support

This fix is already in master branch. Closing.

Pull-Request has been closed by jridky

3 years ago

Yes, it was fixed upstream and released.

Metadata