...
This commit is contained in:
@@ -1091,7 +1091,7 @@ def docs_url(which: str = '', local_docs_root: Optional[str] = '') -> str:
|
|||||||
def sanitize_for_bracketed_paste(text: bytes) -> bytes:
|
def sanitize_for_bracketed_paste(text: bytes) -> bytes:
|
||||||
pat = re.compile(b'(?:(?:\033\\[)|(?:\x9b))201~')
|
pat = re.compile(b'(?:(?:\033\\[)|(?:\x9b))201~')
|
||||||
while True:
|
while True:
|
||||||
new_text = pat.sub(text, b'')
|
new_text = pat.sub(b'', text)
|
||||||
if new_text == text:
|
if new_text == text:
|
||||||
break
|
break
|
||||||
text = new_text
|
text = new_text
|
||||||
|
|||||||
@@ -566,3 +566,4 @@ class TestDataTypes(BaseTest):
|
|||||||
q = sanitize_for_bracketed_paste(x.encode('utf-8'))
|
q = sanitize_for_bracketed_paste(x.encode('utf-8'))
|
||||||
self.assertNotIn(b'\x1b[201~', q)
|
self.assertNotIn(b'\x1b[201~', q)
|
||||||
self.assertNotIn('\x9b201~'.encode('utf-8'), q)
|
self.assertNotIn('\x9b201~'.encode('utf-8'), q)
|
||||||
|
self.assertIn(b'ab', q)
|
||||||
|
|||||||
Reference in New Issue
Block a user