X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/75a9447448d2e5d7acfa925bfead4a1460e1939d..7f3678885fc7ab6f9fb1749f6d2a8ed3468841f3:/black.py diff --git a/black.py b/black.py index dd7fe39..1d2f1a3 100644 --- a/black.py +++ b/black.py @@ -2546,7 +2546,7 @@ def normalize_string_quotes(leaf: Leaf) -> None: leaf.value = f"{prefix}{orig_quote}{body}{orig_quote}" new_body = sub_twice(escaped_orig_quote, rf"\1\2{orig_quote}", new_body) new_body = sub_twice(unescaped_new_quote, rf"\1\\{new_quote}", new_body) - if new_quote == '"""' and new_body[-1] == '"': + if new_quote == '"""' and new_body[-1:] == '"': # edge case: new_body = new_body[:-1] + '\\"' orig_escape_count = body.count("\\")