summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/colorclass/files/colorclass-2.2.0-fix-py3.10.patch')
-rw-r--r--dev-python/colorclass/files/colorclass-2.2.0-fix-py3.10.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/dev-python/colorclass/files/colorclass-2.2.0-fix-py3.10.patch b/dev-python/colorclass/files/colorclass-2.2.0-fix-py3.10.patch
new file mode 100644
index 000000000000..ee67d6d40bb3
--- /dev/null
+++ b/dev-python/colorclass/files/colorclass-2.2.0-fix-py3.10.patch
@@ -0,0 +1,28 @@
+From f8bbe9fdcff1d97b1d0e5dcb94680923cc43a507 Mon Sep 17 00:00:00 2001
+From: Ralph Broenink <ralph@ralphbroenink.net>
+Date: Mon, 24 Aug 2020 14:49:24 +0200
+Subject: [PATCH] Make code forwards-compatible with Python 3.9
+
+Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working
+---
+ colorclass/codes.py | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/colorclass/codes.py b/colorclass/codes.py
+index b0ecb03..8b6085d 100644
+--- a/colorclass/codes.py
++++ b/colorclass/codes.py
+@@ -1,7 +1,12 @@
+ """Handles mapping between color names and ANSI codes and determining auto color codes."""
+
+ import sys
+-from collections import Mapping
++try:
++ # Using or importing the ABCs from 'collections' instead of from 'collections.abc' is
++ # deprecated since Python 3.3, and in 3.9 it will stop working
++ from collections.abc import Mapping
++except ImportError:
++ from collections import Mapping
+
+ BASE_CODES = {
+ '/all': 0, 'b': 1, 'f': 2, 'i': 3, 'u': 4, 'flash': 5, 'outline': 6, 'negative': 7, 'invis': 8, 'strike': 9,