Skip to content

Fix SyntaxWarning due to unescaped sequence - #366

Merged
brian-brazil merged 1 commit into
prometheus:masterfrom
tirkarthi:fix-syntax-warning
Jan 18, 2019
Merged

brian-brazil merged 1 commit into
prometheus:masterfrom
tirkarthi:fix-syntax-warning

Conversation

@tirkarthi

Copy link
Copy Markdown
Contributor

This seemed to be trivial one so I didn't open an issue. This fixes a SyntaxWarning introduced on CPython master that will be released as 3.8. It's already a DeprecationWarning on Python 3.6. The escape sequence needs to be present inside a raw string to fix the warning.

prometheus_client/decorator.py:82
  /home/karthi/client_python/prometheus_client/decorator.py:82: SyntaxWarning: invalid escape sequence \s
    DEF = re.compile('\s*def\s*([_\w][_\w\d]*)\s*\(')

Thanks for the library :)

Signed-off-by: xtreak <tir.karthi@gmail.com>
@brian-brazil
brian-brazil merged commit 4aa1936 into prometheus:master Jan 18, 2019
@brian-brazil

Copy link
Copy Markdown
Contributor

Thanks!

@tirkarthi
tirkarthi deleted the fix-syntax-warning branch January 18, 2019 11:18
@tirkarthi
tirkarthi restored the fix-syntax-warning branch January 18, 2019 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants