Skip to content

Commit a5a8eeb

Browse files
authored
fix DeprecationWarning (huggingface#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.
1 parent 9c71cca commit a5a8eeb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utils/check_copies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def find_code_in_transformers(object_name):
4949
indent = ""
5050
line_index = 0
5151
for name in parts[i + 1 :]:
52-
while line_index < len(lines) and re.search(f"^{indent}(class|def)\s+{name}", lines[line_index]) is None:
52+
while line_index < len(lines) and re.search(fr"^{indent}(class|def)\s+{name}", lines[line_index]) is None:
5353
line_index += 1
5454
indent += " "
5555
line_index += 1

0 commit comments

Comments
 (0)