Skip to content

Commit 3e7cabc

Browse files
authored
Update ansitowin32.py second update to fix re pattern literal string
The pattern should be a raw string, to preserve the special meaning of backslash escape sequences within the re parser and suppress the normal string parsing of sequences.
1 parent 8f13671 commit 3e7cabc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libs/colorama/ansitowin32.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class AnsiToWin32(object):
4040
sequences from the text, and if outputting to a tty, will convert them into
4141
win32 function calls.
4242
'''
43-
ANSI_RE = re.compile('\033\[((?:\\d|;)*)([a-zA-Z])')
43+
ANSI_RE = re.compile(r'\033\[((?:\d|;)*)([a-zA-Z])')
4444

4545
def __init__(self, wrapped, convert=None, strip=None, autoreset=False):
4646
# The wrapped stream (normally sys.stdout or sys.stderr)

0 commit comments

Comments
 (0)