File: 0001-Using-or-importing-the-ABCs-from-collections-instead.patch

package info (click to toggle)
pyocd 0.13.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,144 kB
  • sloc: python: 19,903; xml: 182; ansic: 112; makefile: 65; sh: 47
file content (36 lines) | stat: -rw-r--r-- 1,172 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
32
33
34
35
36
From 796993f12d1fadf7b4158e3ea120c3b91521e3f5 Mon Sep 17 00:00:00 2001
From: Chris Reed <flit@me.com>
Date: Fri, 15 Nov 2019 14:41:54 -0600
Subject: =?UTF-8?q?-=20Using=20or=20importing=20the=20ABCs=20from=20'colle?=
 =?UTF-8?q?ctions'=20instead=20of=20from=0A=20=20'collections.abc'=20is=20?=
 =?UTF-8?q?deprecated=20since=20Python=203.3,=20and=20in=203.9=20it=20will?=
 =?UTF-8?q?=0A=20=20stop=20working.?=

---
 pyocd/utility/sequencer.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/pyocd/utility/sequencer.py b/pyocd/utility/sequencer.py
index bcb34449..1e5b5a43 100644
--- a/pyocd/utility/sequencer.py
+++ b/pyocd/utility/sequencer.py
@@ -14,8 +14,15 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-from collections import (OrderedDict, Callable)
 import logging
+from collections import OrderedDict
+
+# Collection ABCs accessible directly from collections are deprecated and will be removed in
+# Python 3.9.
+try:
+    from collections.abc import Callable
+except ImportError:
+    from collections import Callable
 
 log = logging.getLogger("sequencer")
 
-- 
2.30.2