summaryrefslogtreecommitdiff
path: root/numpy/testing/utils.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2016-12-13 15:53:56 -0700
committerCharles Harris <charlesr.harris@gmail.com>2016-12-14 11:33:22 -0700
commitec0e04694278ef9ea83537d308b07fc27c1b5f85 (patch)
treea28bb53d6827e5449c3f2d5ade3a4ad43bef7ca0 /numpy/testing/utils.py
parent2a1e5a6d2ffdabf2a18875ee8dd57773d608e4c5 (diff)
downloadnumpy-ec0e04694278ef9ea83537d308b07fc27c1b5f85.tar.gz
DEP: Fix escaped string characters deprecated in Python 3.6.
In Python 3.6 a number of escape sequences that were previously accepted -- for instance "\(" that was translated to "\\(" -- are deprecated. To retain the previous behavior either raw strings must be used or the backslash must be properly escaped itself.
Diffstat (limited to 'numpy/testing/utils.py')
-rw-r--r--numpy/testing/utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py
index 0986686c0..859a0705b 100644
--- a/numpy/testing/utils.py
+++ b/numpy/testing/utils.py
@@ -2048,7 +2048,7 @@ class suppress_warnings(object):
warnings.filterwarnings(
"always", category=category, message=message)
else:
- module_regex = module.__name__.replace('.', '\.') + '$'
+ module_regex = module.__name__.replace('.', r'\.') + '$'
warnings.filterwarnings(
"always", category=category, message=message,
module=module_regex)
@@ -2138,7 +2138,7 @@ class suppress_warnings(object):
warnings.filterwarnings(
"always", category=cat, message=mess)
else:
- module_regex = mod.__name__.replace('.', '\.') + '$'
+ module_regex = mod.__name__.replace('.', r'\.') + '$'
warnings.filterwarnings(
"always", category=cat, message=mess,
module=module_regex)