summaryrefslogtreecommitdiff
path: root/numpy/distutils/from_template.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/distutils/from_template.py')
-rw-r--r--numpy/distutils/from_template.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/distutils/from_template.py b/numpy/distutils/from_template.py
index e38e4d608..ff2130297 100644
--- a/numpy/distutils/from_template.py
+++ b/numpy/distutils/from_template.py
@@ -93,7 +93,7 @@ def find_repl_patterns(astr):
names = {}
for rep in reps:
name = rep[0].strip() or unique_key(names)
- repl = rep[1].replace('\,', '@comma@')
+ repl = rep[1].replace(r'\,', '@comma@')
thelist = conv(repl)
names[name] = thelist
return names
@@ -125,13 +125,13 @@ def unique_key(adict):
template_name_re = re.compile(r'\A\s*(\w[\w\d]*)\s*\Z')
def expand_sub(substr, names):
- substr = substr.replace('\>', '@rightarrow@')
- substr = substr.replace('\<', '@leftarrow@')
+ substr = substr.replace(r'\>', '@rightarrow@')
+ substr = substr.replace(r'\<', '@leftarrow@')
lnames = find_repl_patterns(substr)
substr = named_re.sub(r"<\1>", substr) # get rid of definition templates
def listrepl(mobj):
- thelist = conv(mobj.group(1).replace('\,', '@comma@'))
+ thelist = conv(mobj.group(1).replace(r'\,', '@comma@'))
if template_name_re.match(thelist):
return "<%s>" % (thelist)
name = None