From: Armin Ronacher Date: Mon, 20 May 2013 01:05:48 +0000 (+0100) Subject: Some more small cleanup for metaclasses X-Git-Tag: 2.7~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41746b9246e7e17044a3ed8e6e240ada9699ea74;p=thirdparty%2Fjinja.git Some more small cleanup for metaclasses --- diff --git a/jinja2/compiler.py b/jinja2/compiler.py index 4c7a52df..7a42c6d4 100644 --- a/jinja2/compiler.py +++ b/jinja2/compiler.py @@ -10,11 +10,12 @@ """ from itertools import chain from copy import deepcopy +from keyword import iskeyword as is_python_keyword from jinja2 import nodes from jinja2.nodes import EvalContext from jinja2.visitor import NodeVisitor from jinja2.exceptions import TemplateAssertionError -from jinja2.utils import Markup, concat, escape, is_python_keyword +from jinja2.utils import Markup, concat, escape from jinja2._compat import range_type, next, text_type, string_types, \ iteritems, NativeStringIO, imap diff --git a/jinja2/ext.py b/jinja2/ext.py index a88c088d..c2df12d5 100644 --- a/jinja2/ext.py +++ b/jinja2/ext.py @@ -56,7 +56,6 @@ class Extension(with_metaclass(ExtensionRegistry, object)): is a terrible name, ``fragment_cache_prefix`` on the other hand is a good name as includes the name of the extension (fragment cache). """ - __metaclass__ = ExtensionRegistry #: if this extension parses this is the list of tags it's listening to. tags = set() diff --git a/jinja2/nodes.py b/jinja2/nodes.py index 26ba3483..81fafb8b 100644 --- a/jinja2/nodes.py +++ b/jinja2/nodes.py @@ -120,7 +120,6 @@ class Node(with_metaclass(NodeType, object)): The `environment` attribute is set at the end of the parsing process for all nodes automatically. """ - __metaclass__ = NodeType fields = () attributes = ('lineno', 'environment') abstract = True diff --git a/jinja2/utils.py b/jinja2/utils.py index ba781480..b2e2df5f 100644 --- a/jinja2/utils.py +++ b/jinja2/utils.py @@ -64,8 +64,6 @@ else: 'filenames must be strings' return filename -from keyword import iskeyword as is_python_keyword - def contextfunction(f): """This decorator can be used to mark a function or method context callable.