diff options
author | Thibault Roche <thibault.roche@planisware.com> | 2018-04-06 11:08:36 +0200 |
---|---|---|
committer | Marcel Hellkamp <marc@gsites.de> | 2018-07-19 12:47:43 +0200 |
commit | dacb9560e8c9ae1c330ef0d1b5ecbe47c1d7de0f (patch) | |
tree | 71d2b8d904bc682ea24e853246b85f23a079f890 | |
parent | 28793eb604578deb2b11cc1725a5d8985af711fe (diff) | |
download | bottle-dacb9560e8c9ae1c330ef0d1b5ecbe47c1d7de0f.tar.gz |
add the flag in front of the regexp to avoid Deprecation warning (see Issue #949)
-rwxr-xr-x | bottle.py | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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]* (?: ''(?!') |""(?!") @@ -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'): |