Skip to content

Commit

Permalink
ansi-codes: slight regex change
Browse files Browse the repository at this point in the history
\033];3m is considered invalid
so we fix the regex and add a test for it

Signed-off-by: Pierre Tardy <pierre.tardy@intel.com>
  • Loading branch information
Pierre Tardy committed Sep 2, 2013
1 parent c451dd5 commit 8589634
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions master/buildbot/test/unit/test_util_ansi_codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ def test_ansi_notm(self):

def test_ansi_invalid(self):
self.runTest("<>foo", ("\033[<>foo", []))

def test_ansi_invalid_start_by_semicolon(self):
self.runTest(";3m", ("\033[;3m", []))
2 changes: 1 addition & 1 deletion master/buildbot/util/ansicodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import re

ANSI_RE = re.compile(r"^((\d*)(;\d+)*)([a-zA-Z])")
ANSI_RE = re.compile(r"^((\d+)(;\d+)*)([a-zA-Z])")


def parse_ansi_sgr(ansi_entry):
Expand Down

0 comments on commit 8589634

Please sign in to comment.