Make sure value in regex_replace is a string

Fixes #7551
This commit is contained in:
James Cammarata 2014-05-27 14:30:12 -05:00
parent e85c7f848f
commit fa86eef9f9

View file

@ -132,6 +132,10 @@ def search(value, pattern='', ignorecase=False):
def regex_replace(value='', pattern='', replacement='', ignorecase=False):
''' Perform a `re.sub` returning a string '''
if not isinstance(value, basestring):
value = str(value)
if ignorecase:
flags = re.I
else: