Skip to content
Myr

Uses re.compile flags argument, not inline flags (#628)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

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.

authored by jfinkels · committed by David Lord · parent 363ab44 · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:jinja2/filters.py+2 added-2 removed
19 unmodified lines
20from jinja2.exceptions import FilterArgumentError21from jinja2._compat import imap, string_types, text_type, iteritems222324_word_re = re.compile(r'\w+(?u)')25_word_beginning_split_re = re.compile(r'([-\s\(\{\[\<]+)(?u)')24_word_re = re.compile(r'\w+', re.UNICODE)25_word_beginning_split_re = re.compile(r'([-\s\(\{\[\<]+)', re.UNICODE)262728def contextfilter(f):29 """Decorator for marking context dependent filters. The current
973 unmodified lines