Skip to content

Commit

Permalink
Use \33 instead of \x1B.
Browse files Browse the repository at this point in the history
  • Loading branch information
jwilk committed Apr 15, 2024
1 parent cbeed51 commit 2e74e62
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions lib/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
import unicodedata

class _seq:
dim = '\x1B[90m'
off = '\x1B[0m'
warn = '\x1B[30;43m'
error = '\x1B[30;41m'
reverse = '\x1B[7m'
unreverse = '\x1B[27m'
dim = '\33[90m'
off = '\33[0m'
warn = '\33[30;43m'
error = '\33[30;41m'
reverse = '\33[7m'
unreverse = '\33[27m'

def dim(s):
return _seq.dim + escape(s) + _seq.off
Expand Down
2 changes: 1 addition & 1 deletion tests/test_colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def with_stdout(encoding):
def test_control_characters():
def t(s, x):
r = M.escape(s)
assert_equal(r, '\x1B[7m' + x + '\x1B[27m')
assert_equal(r, '\33[7m' + x + '\33[27m')
t('\x00', '^@')
t('\x01', '^A')
t('\x02', '^B')
Expand Down

0 comments on commit 2e74e62

Please sign in to comment.