From 5c8dccc6b9ae31c96985a865ea25d12c01ed28b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 6 Jan 2020 11:44:46 +0100 Subject: [PATCH] Python 3.9 compatibility --- ...4026e9cf6d63d539b359f8ba5155fd48ae21.patch | 35 +++++++++++++++++++ Cython.spec | 3 ++ 2 files changed, 38 insertions(+) create mode 100644 1cd24026e9cf6d63d539b359f8ba5155fd48ae21.patch diff --git a/1cd24026e9cf6d63d539b359f8ba5155fd48ae21.patch b/1cd24026e9cf6d63d539b359f8ba5155fd48ae21.patch new file mode 100644 index 0000000..93dbe8a --- /dev/null +++ b/1cd24026e9cf6d63d539b359f8ba5155fd48ae21.patch @@ -0,0 +1,35 @@ +From 1cd24026e9cf6d63d539b359f8ba5155fd48ae21 Mon Sep 17 00:00:00 2001 +From: Stefan Behnel +Date: Fri, 15 Mar 2019 00:10:05 +0100 +Subject: [PATCH] Import "Iterable" ABC class from "collections.abc" in Py3 + instead of deprecated "collections" package. + +--- + Cython/Build/Dependencies.py | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/Cython/Build/Dependencies.py b/Cython/Build/Dependencies.py +index a4e5c60bee..eb03004e24 100644 +--- a/Cython/Build/Dependencies.py ++++ b/Cython/Build/Dependencies.py +@@ -18,6 +18,11 @@ + from distutils.util import strtobool + import zipfile + ++try: ++ from collections.abc import Iterable ++except ImportError: ++ from collections import Iterable ++ + try: + import gzip + gzip_open = gzip.open +@@ -749,7 +754,7 @@ def create_extension_list(patterns, exclude=None, ctx=None, aliases=None, quiet= + exclude = [] + if patterns is None: + return [], {} +- elif isinstance(patterns, basestring) or not isinstance(patterns, collections.Iterable): ++ elif isinstance(patterns, basestring) or not isinstance(patterns, Iterable): + patterns = [patterns] + explicit_modules = set([m.name for m in patterns if isinstance(m, Extension)]) + seen = set() diff --git a/Cython.spec b/Cython.spec index 6387565..c8e155a 100644 --- a/Cython.spec +++ b/Cython.spec @@ -13,6 +13,9 @@ License: ASL 2.0 URL: http://www.cython.org Source: https://github.com/cython/cython/archive/%{upver}/%{srcname}-%{version}.tar.gz +# Python 3.9 compatibility +Patch1: https://github.com/cython/cython/commit/1cd24026e9cf6d63d539b359f8ba5155fd48ae21.patch + BuildRequires: gcc %if %{with tests} BuildRequires: gcc-c++