File: 0004-Fix-DeprecationWarning-with-Python-3.7.patch

package info (click to toggle)
python-datrie 0.7.1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,852 kB
  • sloc: ansic: 3,639; python: 508; makefile: 10; sh: 1
file content (26 lines) | stat: -rw-r--r-- 697 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
From: Mattia Rizzolo <mattia@debian.org>
Date: Mon, 24 Sep 2018 13:26:34 +0200
Subject: Fix DeprecationWarning with Python 3.7.

Bug-Debian: https://bugs.debian.org/904187
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
---
 src/datrie.pyx | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/datrie.pyx b/src/datrie.pyx
index f969c7c..db1a091 100644
--- a/src/datrie.pyx
+++ b/src/datrie.pyx
@@ -15,7 +15,10 @@ import itertools
 import warnings
 import sys
 import tempfile
-from collections import MutableMapping
+try:
+    from collections.abc import MutableMapping
+except ImportError:
+    from collections import MutableMapping
 
 try:
     import cPickle as pickle