Skip to content

Commit

Permalink
add the flag in front of the regexp to avoid Deprecation warning (see…
Browse files Browse the repository at this point in the history
… Issue #949)
  • Loading branch information
Thibault Roche authored and defnull committed Jul 19, 2018
1 parent 28793eb commit dacb956
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bottle.py
Expand Up @@ -4021,7 +4021,7 @@ class StplParser(object):
# This huge pile of voodoo magic splits python code into 8 different tokens.
# We use the verbose (?x) regex mode to make this more manageable

_re_tok = _re_inl = r'''(?mx)( # verbose and dot-matches-newline mode
_re_tok = _re_inl = r'''(
[urbURB]*
(?: ''(?!')
|""(?!")
Expand Down Expand Up @@ -4063,6 +4063,12 @@ class StplParser(object):
# Match inline statements (may contain python strings)
_re_inl = r'''%%(inline_start)s((?:%s|[^'"\n]+?)*?)%%(inline_end)s''' % _re_inl

# add the flag in front of the regexp to avoid Deprecation warning (see Issue #949)
# verbose and dot-matches-newline mode
_re_tok = '(?mx)' + _re_tok
_re_inl = '(?mx)' + _re_inl


default_syntax = '<% %> % {{ }}'

def __init__(self, source, syntax=None, encoding='utf8'):
Expand Down

0 comments on commit dacb956

Please sign in to comment.