From 4f830eb316f25c9c1ebd3d44f68e8dedacc150ae Mon Sep 17 00:00:00 2001 From: ichuang Date: Tue, 10 Jul 2012 22:32:46 -0400 Subject: [PATCH] fix static_replace use of re.subs flags to be python2.6 compatible --- common/djangoapps/static_replace.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/djangoapps/static_replace.py b/common/djangoapps/static_replace.py index cc698a5714..70031cc754 100644 --- a/common/djangoapps/static_replace.py +++ b/common/djangoapps/static_replace.py @@ -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\\?['"]) # the opening quotes {prefix} # the prefix (?P.*?) # 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)