diff options
author | Arthur Zamarin <arthurzam@gmail.com> | 2021-08-06 11:30:25 +0300 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2021-08-07 14:16:25 +0200 |
commit | e244d8f51174263a87ef2d49f1d2b4770c03ead1 (patch) | |
tree | e2c5a5f17689e575c7b1c681007e2b04d2c49c4c /dev-python/pygal | |
parent | media-gfx/cairosvg: mark ALLARCHES (diff) | |
download | gentoo-e244d8f51174263a87ef2d49f1d2b4770c03ead1.tar.gz gentoo-e244d8f51174263a87ef2d49f1d2b4770c03ead1.tar.bz2 gentoo-e244d8f51174263a87ef2d49f1d2b4770c03ead1.zip |
dev-python/pygal: enable py3.10
apply patch from a PR
Signed-off-by: Arthur Zamarin <arthurzam@gmail.com>
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/pygal')
-rw-r--r-- | dev-python/pygal/files/pygal-2.4.0-fix-py3.10.patch | 39 | ||||
-rw-r--r-- | dev-python/pygal/pygal-2.4.0-r2.ebuild | 7 |
2 files changed, 44 insertions, 2 deletions
diff --git a/dev-python/pygal/files/pygal-2.4.0-fix-py3.10.patch b/dev-python/pygal/files/pygal-2.4.0-fix-py3.10.patch new file mode 100644 index 000000000000..ded4ad2ef338 --- /dev/null +++ b/dev-python/pygal/files/pygal-2.4.0-fix-py3.10.patch @@ -0,0 +1,39 @@ +From 1525f5e7c18032b34b1be282341d60641161194d Mon Sep 17 00:00:00 2001 +From: Dooley_labs <elderlabs@users.noreply.github.com> +Date: Sat, 28 Dec 2019 02:29:38 -0500 +Subject: [PATCH] Python 3 compatibility patches + +--- + pygal/_compat.py | 5 ++++- + pygal/util.py | 2 +- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/pygal/_compat.py b/pygal/_compat.py +index 07ab8846..815585f1 100644 +--- a/pygal/_compat.py ++++ b/pygal/_compat.py +@@ -20,7 +20,10 @@ + 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/pygal/util.py b/pygal/util.py +index 65236173..cca29dbf 100644 +--- a/pygal/util.py ++++ b/pygal/util.py +@@ -275,7 +275,7 @@ def minify_css(css): + # Inspired by slimmer by Peter Bengtsson + remove_next_comment = 1 + for css_comment in css_comments.findall(css): +- if css_comment[-3:] == '\*/': ++ if css_comment[-3:] == r'\*/': + remove_next_comment = 0 + continue + if remove_next_comment: diff --git a/dev-python/pygal/pygal-2.4.0-r2.ebuild b/dev-python/pygal/pygal-2.4.0-r2.ebuild index c67f4dee8145..81ee85dc3d48 100644 --- a/dev-python/pygal/pygal-2.4.0-r2.ebuild +++ b/dev-python/pygal/pygal-2.4.0-r2.ebuild @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=7 -PYTHON_COMPAT=( python3_{7..9} ) +PYTHON_COMPAT=( python3_{8..10} ) PYTHON_REQ_USE="xml(+)" inherit distutils-r1 @@ -24,7 +24,10 @@ RDEPEND=" BDEPEND=" test? ( dev-python/pyquery[${PYTHON_USEDEP}] )" -PATCHES=( "${FILESDIR}/${PV}-fix-tests.patch" ) +PATCHES=( + "${FILESDIR}/${PV}-fix-tests.patch" + "${FILESDIR}/${P}-fix-py3.10.patch" +) # CHANGELOG is a symlink to docs/changelog.rst DOCS=( docs/changelog.rst README.md ) |