summaryrefslogtreecommitdiff
path: root/dev-python/patsy/files/patsy-0.5.1-py310.patch
blob: 04a712e7e426db3a596467a216074f228ab9f1c3 (plain)
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
37
38
39
From 6328c7652e4d7fda9872a555d31658e54b7b0e6e Mon Sep 17 00:00:00 2001
From: thequackdaddy <pquack@gmail.com>
Date: Sun, 28 Oct 2018 19:38:08 -0500
Subject: [PATCH] MAINT: A few python 3.7 fixes

---
 patsy/constraint.py     | 5 ++++-
 tools/check-API-refs.py | 2 +-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/patsy/constraint.py b/patsy/constraint.py
index ca9f6e2..d710a94 100644
--- a/patsy/constraint.py
+++ b/patsy/constraint.py
@@ -10,7 +10,10 @@
 __all__ = ["LinearConstraint"]
 
 import re
-from collections import Mapping
+try:
+    from collections.abc import Mapping
+except ImportError:
+    from collections import Mapping
 import six
 import numpy as np
 from patsy import PatsyError
diff --git a/tools/check-API-refs.py b/tools/check-API-refs.py
index 8e9e8a1..9349028 100644
--- a/tools/check-API-refs.py
+++ b/tools/check-API-refs.py
@@ -9,7 +9,7 @@
 root = dirname(dirname(abspath(__file__)))
 patsy_ref = root + "/doc/API-reference.rst"
 
-doc_re = re.compile("^\.\. (.*):: ([^\(]*)")
+doc_re = re.compile("^\\.\\. (.*):: ([^\\(]*)")
 def _documented(rst_path):
     documented = set()
     for line in open(rst_path):