From ec0e04694278ef9ea83537d308b07fc27c1b5f85 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Tue, 13 Dec 2016 15:53:56 -0700 Subject: 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. --- numpy/testing/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'numpy/testing/utils.py') 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) -- cgit v1.2.1