Commit 4f830eb3 by ichuang

fix static_replace use of re.subs flags to be python2.6 compatible

parent 84838cf2
......@@ -18,8 +18,9 @@ def replace_urls(text, staticfiles_prefix=None, replace_prefix='/static/'):
return replace(static_url, staticfiles_prefix)
return re.sub(r"""
(?x) # flags=re.VERBOSE
(?P<quote>\\?['"]) # the opening quotes
{prefix} # the prefix
(?P<rest>.*?) # everything else in the url
(?P=quote) # the first matching closing quote
""".format(prefix=replace_prefix), replace_url, text, flags=re.VERBOSE)
""".format(prefix=replace_prefix), replace_url, text)
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