From a5a8eeb772b185b0746f3ce9be6ae43181d2ca71 Mon Sep 17 00:00:00 2001 From: Stas Bekman Date: Thu, 15 Oct 2020 13:21:09 -0700 Subject: [PATCH] fix DeprecationWarning (#7834) in `tests/test_utils_check_copies.py` I was getting intermittently: ``` utils/check_copies.py:52 /mnt/nvme1/code/transformers-comet/utils/check_copies.py:52: DeprecationWarning: invalid escape sequence \s while line_index < len(lines) and re.search(f"^{indent}(class|def)\s+{name}", lines[line_index]) is None: ``` So this should fix it. --- utils/check_copies.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/check_copies.py b/utils/check_copies.py index 264c914e0..d8c0f23f8 100644 --- a/utils/check_copies.py +++ b/utils/check_copies.py @@ -49,7 +49,7 @@ def find_code_in_transformers(object_name): indent = "" line_index = 0 for name in parts[i + 1 :]: - while line_index < len(lines) and re.search(f"^{indent}(class|def)\s+{name}", lines[line_index]) is None: + while line_index < len(lines) and re.search(fr"^{indent}(class|def)\s+{name}", lines[line_index]) is None: line_index += 1 indent += " " line_index += 1