Unverified Commit a5a8eeb7 authored by Stas Bekman's avatar Stas Bekman Committed by GitHub
Browse files

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.
parent 9c71cca3
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment