X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/f1813e31b6deed0901c8a7fb1f102b9af53de351..4f5268af4f0939fbc0d5ec4fd3d113b40a4c92e9:/src/black/trans.py?ds=sidebyside diff --git a/src/black/trans.py b/src/black/trans.py index 6aca3a8..cb41c1b 100644 --- a/src/black/trans.py +++ b/src/black/trans.py @@ -4,7 +4,7 @@ String transformers that can split and merge strings. from abc import ABC, abstractmethod from collections import defaultdict from dataclasses import dataclass -import regex as re # We need recursive patterns here (?R) +import re from typing import ( Any, Callable, @@ -453,7 +453,7 @@ class StringMerger(StringTransformer, CustomSplitMapMixin): # with 'f'... if "f" in prefix and "f" not in next_prefix: # Then we must escape any braces contained in this substring. - SS = re.subf(r"(\{|\})", "{1}{1}", SS) + SS = re.sub(r"(\{|\})", r"\1\1", SS) NSS = make_naked(SS, next_prefix)