Skip to content

Commit e38e6c2

Browse files
authored
fix string_to_dict test (#7571)
1 parent aa92e27 commit e38e6c2

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/datasets/utils/py_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ def string_to_dict(string: str, pattern: str) -> Optional[dict[str, str]]:
180180
Optional[dict[str, str]]: dictionary of variable -> value, retrieved from the input using the pattern, or
181181
`None` if the string does not match the pattern.
182182
"""
183-
pattern = pattern.encode("unicode_escape").decode("utf-8") # C:\\Users -> C:\\\\Users for Windows paths
184183
pattern = re.sub(r"{([^:}]+)(?::[^}]+)?}", r"{\1}", pattern) # remove format specifiers, e.g. {rank:05d} -> {rank}
185184
regex = re.sub(r"{(.+?)}", r"(?P<_\1>.+)", pattern)
186185
result = re.search(regex, string)

0 commit comments

Comments
 (0)