fix: compatibility with black v25+ (#15789)

This commit is contained in:
Peter Braun
2025-01-29 16:06:14 +01:00
committed by GitHub
parent aa0f2e362b
commit d36cd6c6ab
5 changed files with 10 additions and 10 deletions

View File

@@ -266,9 +266,9 @@ def random_utf8(*args, **kwargs):
exception when a character outside of the BMP is sent to `send_keys`.
Code pulled from http://stackoverflow.com/a/3220210.
"""
pattern = re.compile('[^\u0000-\uD7FF\uE000-\uFFFF]', re.UNICODE)
pattern = re.compile('[^\u0000-\ud7ff\ue000-\uffff]', re.UNICODE)
length = args[0] if len(args) else kwargs.get('length', 10)
scrubbed = pattern.sub('\uFFFD', ''.join([gen_utf_char() for _ in range(length)]))
scrubbed = pattern.sub('\ufffd', ''.join([gen_utf_char() for _ in range(length)]))
return scrubbed