Skip to content
Myr

jinja2.sandbox should not warn on 2.6 any more.

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

--HG-- branch : trunk

authored by Armin Ronacher · committed by Armin Ronacher · parent 3f1d8f1 · Browse files · 1 file+15 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+15 added−2 removed

  • other:+15 added−2 removed

1 file+15 added−2 removed

modified:jinja2/sandbox.py+15 added-2 removed
29 unmodified lines
30#: unsafe method attributes. function attributes are unsafe for methods too31UNSAFE_METHOD_ATTRIBUTES = set(['im_class', 'im_func', 'im_self'])323334import warnings3536# make sure we don't warn in python 2.6 about stuff we don't care about37warnings.filterwarnings('ignore', 'the sets module', DeprecationWarning,38 module='jinja2.sandbox')394041from collections import deque35from sets import Set, ImmutableSet42from UserDict import UserDict, DictMixin43from UserList import UserList38_mutable_set_types = (ImmutableSet, Set, set)44_mutable_set_types = (set,)45_mutable_mapping_types = (UserDict, DictMixin, dict)46_mutable_sequence_types = (UserList, list)4748# if sets is still available, register the mutable set from there as well49try:50 from sets import Set51 _mutable_set_types += (Set,)52except ImportError:53 pass5455#: register Python 2.6 abstract base classes56try:57 from collections import MutableSet, MutableMapping, MutableSequence58 _mutable_set_types += (MutableSet,)
205 unmodified lines