From: jfinkels Date: Sun, 25 Dec 2016 23:10:33 +0000 (-0500) Subject: Uses re.compile flags argument, not inline flags (#628) X-Git-Tag: 2.9~87^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b42f53540469b54947b7de05143c9518b6d23c66;p=thirdparty%2Fjinja.git Uses re.compile flags argument, not inline flags (#628) This commit replaces the use of terminal inline flags in a regular expression in `re.compile`, re.compile(r'\w+(?u)') with arguments to the `re.compile` function itself, re.compile(r'\w+', re.UNICODE) because the former is deprecated as of Python 3.6. --- diff --git a/jinja2/filters.py b/jinja2/filters.py index a4504069..b5fa456f 100644 --- a/jinja2/filters.py +++ b/jinja2/filters.py @@ -21,8 +21,8 @@ from jinja2.exceptions import FilterArgumentError from jinja2._compat import imap, string_types, text_type, iteritems -_word_re = re.compile(r'\w+(?u)') -_word_beginning_split_re = re.compile(r'([-\s\(\{\[\<]+)(?u)') +_word_re = re.compile(r'\w+', re.UNICODE) +_word_beginning_split_re = re.compile(r'([-\s\(\{\[\<]+)', re.UNICODE) def contextfilter(f):