Skip to content
Myr

[svn] fixed bug in replace filter discovered by ronny

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 6fa4ae7 · Browse files · 1 file+3 added−3 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+3 added−3 removed

  • other:+3 added−3 removed

1 file+3 added−3 removed

modified:jinja/filters.py+3 added-3 removed
68 unmodified lines
69 if not isinstance(old, basestring) or \70 not isinstance(new, basestring):71 raise FilterArgumentError('the replace filter requires '72 'string replacement arguments')73 if count is None:74 return s.replace(old, new)73 elif not isinstance(count, (int, long)):75 if not isinstance(count, (int, long)):76 raise FilterArgumentError('the count parameter of the '77 'replace filter requires '78 'an integer')77 if count is None:78 return s.replace(old, new)79 return s.replace(old, new, count)80do_replace = stringfilter(do_replace)8182
568 unmodified lines