File: 0002-python-3.10-fix.patch

package info (click to toggle)
python-pygal 2.4.0-2.3
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 672 kB
  • sloc: python: 7,116; makefile: 9
file content (31 lines) | stat: -rw-r--r-- 809 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From 7796f14c80fe82b9435cdc33b7d2939c8331d649 Mon Sep 17 00:00:00 2001
From: Jake Bell <sigterm01@gmail.com>
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: