fixed some NameErrors
Before adoption: this commit came in with the history the project adopted, so no landing records it.
--HG-- branch : trunk
authored by Benjamin Wiegand · committed by Benjamin Wiegand · parent 157531b · Browse files · 6 files·+12 added−4 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
6 files+12 added−4 removed
- other:+12 added−4 removed
Provenance
- Commit
a315274- Tree
4f82378- Author
Benjamin Wiegand <highwaychile@bluevaria.de>- Committer
Benjamin Wiegand <highwaychile@bluevaria.de>- Parent
157531b
6 files changed+12 added−4 removed
modified:jinja2/exceptions.py+6 added
43 unmodified lines44 45 46 class TemplateRuntimeError(TemplateError):47 """A runtime error."""48+49+50+class FilterArgumentError(Exception):51+ """This error is raised if a filter was called with inappropriate52+ arguments53+ """modified:jinja2/ext.py+1 added-1 removed
13 unmodified lines14 from jinja2 import nodes15 from jinja2.environment import get_spontaneous_environment16 from jinja2.runtime import Undefined, concat17 from jinja2.parser import statement_end_tokens18-from jinja2.exceptions import TemplateAssertionError18+from jinja2.exceptions import TemplateAssertionError, TemplateSyntaxError19 from jinja2.utils import import_string, Markup20 21 22 # the only real useful gettext functions for a Jinja template. Note272 unmodified linesmodified:jinja2/filters.py+1 added
17 unmodified lines18 from urllib import urlencode, quote19 from itertools import imap, groupby20 from jinja2.utils import Markup, escape, pformat, urlize, soft_unicode21 from jinja2.runtime import Undefined22+from jinja2.exceptions import FilterArgumentError23 24 25 _striptags_re = re.compile(r'(<!--.*?-->|<[^>]*>)')26 647 unmodified linesmodified:jinja2/nodes.py+2 added-1 removed
502 unmodified lines503 def as_const(self):504 if self.ctx != 'load':505 raise Impossible()506 try:507- return environmen.subscribe(self.node.as_const(), self.arg.as_const())507+ return self.environment.subscribe(self.node.as_const(),508+ self.arg.as_const())509 except:510 raise Impossible()511 512 def can_assign(self):108 unmodified linesmodified:jinja2/parser.py+1 added-1 removed
533 unmodified lines534 self.stream.expect('rbracket')535 if len(args) == 1:536 arg = args[0]537 else:538- arg = nodes.Tuple(args, lineno, self.filename)538+ arg = nodes.Tuple(args, self.lineno, self.filename)539 else:540 raise TemplateSyntaxError('expected subscript expression',541 self.lineno, self.filename)542 return nodes.Subscript(node, arg, 'load', lineno=token.lineno)161 unmodified linesmodified:jinja2/utils.py+1 added-1 removed
410 unmodified lines411 try:412 from functools import partial413 except ImportError:414 class partial(object):415- def __init__(self, _func, *args, **kwargs):415+ def __init__(self, func, *args, **kwargs):416 self._func = func417 self._args = args418 self._kwargs = kwargs419 def __call__(self, *args, **kwargs):2 unmodified lines