From 41746b9246e7e17044a3ed8e6e240ada9699ea74 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 20 May 2013 02:05:48 +0100 Subject: Some more small cleanup for metaclasses --- jinja2/compiler.py | 3 ++- jinja2/ext.py | 1 - jinja2/nodes.py | 1 - jinja2/utils.py | 2 -- 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/jinja2/compiler.py b/jinja2/compiler.py index 4c7a52d..7a42c6d 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 a88c088..c2df12d 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 26ba348..81fafb8 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 ba78148..b2e2df5 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. -- cgit v1.2.1