Skip to content
Myr

Removed some no longer needed code from compat

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

authored by Armin Ronacher · committed by Armin Ronacher · parent 1c5315a · Browse files · 3 files+6 added−20 removed
This commit

State

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

Diff stats

3 files+6 added−20 removed

  • other:+6 added−20 removed

3 files+6 added−20 removed

modified:jinja2/_compat.py-16 removed
102 unmodified lines
103 return metaclass('temporary_class', None, {})104105106try:107 from collections import Mapping as mapping_types108except ImportError:109 import UserDict110 mapping_types = (UserDict.UserDict, UserDict.DictMixin, dict)111112113try:107 from urllib.parse import quote_from_bytes as url_quote108except ImportError:109 from urllib import quote as url_quote117118119try:120 from thread import allocate_lock121except ImportError:122 try:123 from threading import Lock as allocate_lock124 except ImportError:125 from dummy_thread import allocate_lock
modified:jinja2/tests.py+3 added-2 removed
7 unmodified lines
8 :copyright: (c) 2010 by the Jinja Team.9 :license: BSD, see LICENSE for more details.10"""11import re12from collections import Mapping13from jinja2.runtime import Undefined13from jinja2._compat import text_type, string_types, mapping_types14from jinja2._compat import text_type, string_types151617number_re = re.compile(r'^-?\d+(\.\d+)?$')18regex_type = type(number_re)
63 unmodified lines
82 """Return true if the object is a mapping (dict etc.).8384 .. versionadded:: 2.685 """85 return isinstance(value, mapping_types)86 return isinstance(value, Mapping)878889def test_number(value):90 """Return true if the variable is a number."""
60 unmodified lines
modified:jinja2/utils.py+3 added-2 removed
9 unmodified lines
10"""11import re12import errno13from collections import deque14from threading import Lock15from jinja2._compat import text_type, string_types, implements_iterator, \15 allocate_lock, url_quote16 url_quote171819_word_split_re = re.compile(r'(\s+)')20_punctuation_re = re.compile(
288 unmodified lines
309 # alias all queue methods for faster lookup310 self._popleft = self._queue.popleft311 self._pop = self._queue.pop312 self._remove = self._queue.remove312 self._wlock = allocate_lock()313 self._wlock = Lock()314 self._append = self._queue.append315316 def __getstate__(self):317 return {
204 unmodified lines