mkenums: make string raw for real regex

Signed-off-by: Igor Gnatenko <ignatenko@src.gnome.org>
This commit is contained in:
Igor Gnatenko 2017-07-15 15:26:54 +02:00
parent d753a411c0
commit 615238d0a4

View File

@ -84,7 +84,7 @@ def parse_entries(file, file_name):
continue continue
if looking_for_name: if looking_for_name:
m = re.match('\s*(\w+)', line) m = re.match(r'\s*(\w+)', line)
if m: if m:
enumname = m.group(1) enumname = m.group(1)
return True return True
@ -141,7 +141,7 @@ def parse_entries(file, file_name):
entries.append((name, value, options['nick'])) entries.append((name, value, options['nick']))
else: else:
entries.append((name, value)) entries.append((name, value))
elif re.match('s*\#', line): elif re.match(r's*\#', line):
pass pass
else: else:
sys.exit("Failed to parse %s." % file_name) sys.exit("Failed to parse %s." % file_name)