Skip to content

Commit 0120058

Browse files
committed
Fix invalid escape sequences
Fixes #311.
1 parent c6b3772 commit 0120058

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.gdbinit

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ prompt, see the command `python print(gdb.prompt.prompt_help())`''',
103103
104104
See the `prompt` attribute. This value is used as a Python format string where
105105
`{pid}` is expanded with the process identifier of the target program.''',
106-
'default': '\[\e[1;35m\]>>>\[\e[0m\]'
106+
'default': r'\[\e[1;35m\]>>>\[\e[0m\]'
107107
},
108108
'prompt_not_running': {
109109
'doc': '''Define the value of `{status}` when the target program is running.
110110
111111
See the `prompt` attribute. This value is used as a Python format string.''',
112-
'default': '\[\e[90m\]>>>\[\e[0m\]'
112+
'default': r'\[\e[90m\]>>>\[\e[0m\]'
113113
},
114114
# divider
115115
'omit_divider': {
@@ -2099,7 +2099,7 @@ architectures different from x86 setting this attribute might be mandatory.''',
20992099
if len(fields) != 7:
21002100
continue
21012101
name, _, _, _, _, _, groups = fields
2102-
if not re.match('\w', name):
2102+
if not re.match(r'\w', name):
21032103
continue
21042104
for group in groups.split(','):
21052105
if group in (match_groups or ('general',)):
@@ -2187,7 +2187,7 @@ class Expressions(Dashboard.Module):
21872187
default_radix = Expressions.get_default_radix()
21882188
for number, expression in enumerate(self.table, start=1):
21892189
label = expression
2190-
match = re.match('^/(\d+) +(.+)$', expression)
2190+
match = re.match(r'^/(\d+) +(.+)$', expression)
21912191
try:
21922192
if match:
21932193
radix, expression = match.groups()
@@ -2262,7 +2262,7 @@ class Expressions(Dashboard.Module):
22622262
except RuntimeError:
22632263
# XXX this is a fix for GDB <8.1.x see #161
22642264
message = run('show output-radix')
2265-
match = re.match('^Default output radix for printing of values is (\d+)\.$', message)
2265+
match = re.match(r'^Default output radix for printing of values is (\d+)\.$', message)
22662266
return match.groups()[0] if match else 10 # fallback
22672267

22682268
# XXX workaround to support BP_BREAKPOINT in older GDB versions

0 commit comments

Comments
 (0)