From 81c62687579fd170084bfa8b0dab9feb710c78f2 Mon Sep 17 00:00:00 2001 From: Jake Bell Date: Jun 18 2021 08:11:41 +0000 Subject: Backport of upstream commit to add compatibility with Python 3.10 --- diff --git a/7796f14c80fe82b9435cdc33b7d2939c8331d649.patch b/7796f14c80fe82b9435cdc33b7d2939c8331d649.patch new file mode 100644 index 0000000..6dbbbc0 --- /dev/null +++ b/7796f14c80fe82b9435cdc33b7d2939c8331d649.patch @@ -0,0 +1,31 @@ +From 7796f14c80fe82b9435cdc33b7d2939c8331d649 Mon Sep 17 00:00:00 2001 +From: Jake Bell +Date: Thu, 8 Oct 2020 13:46:33 -0500 +Subject: [PATCH] Importing `Iterator` from `collections.abc` to avoid + deprecation warnings + +https://docs.python.org/3/library/collections.abc.html + +Fixes #500 +--- + pygal/_compat.py | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/pygal/_compat.py b/pygal/_compat.py +index 07ab8846..967ebd51 100644 +--- a/pygal/_compat.py ++++ b/pygal/_compat.py +@@ -20,7 +20,12 @@ + from __future__ import division + + import sys +-from collections import Iterable ++ ++try: ++ from collections.abc import Iterable ++except ImportError: ++ from collections import Iterable ++ + from datetime import datetime, timedelta, tzinfo + + if sys.version_info[0] == 3: diff --git a/python-pygal.spec b/python-pygal.spec index 529c89d..1c6ce58 100644 --- a/python-pygal.spec +++ b/python-pygal.spec @@ -10,6 +10,9 @@ License: LGPLv3+ URL: https://pypi.io/project/pygal Source0: https://pypi.io/packages/source/p/%{modname}/%{modname}-%{version}.tar.gz +# Backport of upstream commit to add compatibility with Python 3.10 +Patch1: https://github.com/Kozea/pygal/commit/7796f14c80fe82b9435cdc33b7d2939c8331d649.patch + BuildArch: noarch BuildRequires: python3-devel @@ -41,6 +44,7 @@ A python svg graph plotting library %prep %setup -q -n %{modname}-%{version} +%patch1 -p1 # Remove bundled egg-info in case it exists rm -rf %{modname}.egg-info