From 15aa4c88f6052af6279e6be3fcd2f968f1c53eae Mon Sep 17 00:00:00 2001 From: Anish Shah Date: Fri, 3 Mar 2017 13:42:03 +0530 Subject: [PATCH] bpo-29693: Fix for DeprecationWarning in test_import (#421) Patch by Anish Shah. --- Lib/test/test_import/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_import/__init__.py b/Lib/test/test_import/__init__.py index 6e8ed3686d..d4b4445929 100644 --- a/Lib/test/test_import/__init__.py +++ b/Lib/test/test_import/__init__.py @@ -85,7 +85,7 @@ class ImportTests(unittest.TestCase): from os import i_dont_exist self.assertEqual(cm.exception.name, 'os') self.assertEqual(cm.exception.path, os.__file__) - self.assertRegex(str(cm.exception), "cannot import name 'i_dont_exist' from 'os' \(.*os.py\)") + self.assertRegex(str(cm.exception), r"cannot import name 'i_dont_exist' from 'os' \(.*os.py\)") def test_from_import_missing_attr_has_name_and_so_path(self): import select @@ -93,7 +93,7 @@ class ImportTests(unittest.TestCase): from select import i_dont_exist self.assertEqual(cm.exception.name, 'select') self.assertEqual(cm.exception.path, select.__file__) - self.assertRegex(str(cm.exception), "cannot import name 'i_dont_exist' from 'select' \(.*\.(so|pyd)\)") + self.assertRegex(str(cm.exception), r"cannot import name 'i_dont_exist' from 'select' \(.*\.(so|pyd)\)") def test_from_import_missing_attr_has_name(self): with self.assertRaises(ImportError) as cm: -- 2.40.0