Skip to content

Commit 4a00a66

Browse files
Fix SyntaxWarning for invalid escape sequence re.sub
Replaced the regular expression '\s+' with a raw string r'\s+' to resolve the SyntaxWarning: invalid escape sequence '\s' This ensures proper handling of whitespace matching in both Python 2 and 3 environments.
1 parent 7be15b5 commit 4a00a66

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hpilo_cli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def hpilo_help(option, opt_str, value, parser, exitcode=0):
266266
doc = re.sub(r':[a-z]+:`(.*?)`', r'\1', doc)
267267
if 'API note' in doc:
268268
doc = doc[:doc.find('API note')].strip()
269-
doc = re.sub('\s+', ' ', doc)
269+
doc = re.sub(r'\s+', ' ', doc)
270270
print(textwrap.fill(doc, 80))
271271
else:
272272
print("No such method: %s" % value)

0 commit comments

Comments
 (0)