8000 sty: Apply ruff preview rule RUF039 · nipy/nibabel@d38f469 · GitHub
[go: up one dir, main page]

Skip to content

Commit d38f469

Browse files
sty: Apply ruff preview rule RUF039
RUF039 First argument to `re.sub()` is not raw string
1 parent 5166add commit d38f469

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nibabel/cmdline/diff.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -309,11 +309,11 @@ def display_diff(files, diff):
309309
item_str = str(item)
310310
# Value might start/end with some invisible spacing characters so we
311311
# would "condition" it on both ends a bit
312-
item_str = re.sub('^[ \t]+', '<', item_str)
313-
item_str = re.sub('[ \t]+$', '>', item_str)
312+
item_str = re.sub(r'^[ \t]+', '<', item_str)
313+
item_str = re.sub(r'[ \t]+$', '>', item_str)
314314
# and also replace some other invisible symbols with a question
315315
# mark
316-
item_str = re.sub('[\x00]', '?', item_str)
316+
item_str = re.sub(r'[\x00]', '?', item_str)
317317
output += value_width.format(item_str)
318318

319319
output += '\n'

0 commit comments

Comments
 (0)
0