Commit 915e5340 authored by Andrew M. Kuchling's avatar Andrew M. Kuchling

Fix bug when the replacement template is a callable object

parent 220fd839
...@@ -90,7 +90,7 @@ def _expand(match, template): ...@@ -90,7 +90,7 @@ def _expand(match, template):
def _subn(pattern, template, string, count=0): def _subn(pattern, template, string, count=0):
# internal: pattern.subn implementation hook # internal: pattern.subn implementation hook
if callable(template): if callable(template):
filter = callable filter = template
else: else:
# FIXME: prepare template # FIXME: prepare template
def filter(match, template=template): def filter(match, template=template):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment