summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Roche <thibault.roche@planisware.com>2018-04-06 11:08:36 +0200
committerMarcel Hellkamp <marc@gsites.de>2018-07-19 12:47:43 +0200
commitdacb9560e8c9ae1c330ef0d1b5ecbe47c1d7de0f (patch)
tree71d2b8d904bc682ea24e853246b85f23a079f890
parent28793eb604578deb2b11cc1725a5d8985af711fe (diff)
downloadbottle-dacb9560e8c9ae1c330ef0d1b5ecbe47c1d7de0f.tar.gz
add the flag in front of the regexp to avoid Deprecation warning (see Issue #949)
-rwxr-xr-xbottle.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/bottle.py b/bottle.py
index 8c689dd..8721b66 100755
--- a/bottle.py
+++ b/bottle.py
@@ -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'):