[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 for-2.9 18/47] qapi: Use raw strings for regular
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PATCH v2 for-2.9 18/47] qapi: Use raw strings for regular expressions consistently |
Date: |
Wed, 15 Mar 2017 13:57:07 +0100 |
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
scripts/qapi.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/scripts/qapi.py b/scripts/qapi.py
index 748d7ad..8088f60 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -554,7 +554,7 @@ def discriminator_find_enum_define(expr):
# Names must be letters, numbers, -, and _. They must start with letter,
# except for downstream extensions which must start with __RFQDN_.
# Dots are only valid in the downstream extension prefix.
-valid_name = re.compile('^(__[a-zA-Z0-9.-]+_)?'
+valid_name = re.compile(r'^(__[a-zA-Z0-9.-]+_)?'
'[a-zA-Z][a-zA-Z0-9_-]*$')
@@ -1831,10 +1831,10 @@ def cgen(code, **kwds):
if indent_level:
indent = genindent(indent_level)
# re.subn() lacks flags support before Python 2.7, use re.compile()
- raw = re.subn(re.compile("^.", re.MULTILINE),
+ raw = re.subn(re.compile(r'^.', re.MULTILINE),
indent + r'\g<0>', raw)
raw = raw[0]
- return re.sub(re.escape(eatspace) + ' *', '', raw)
+ return re.sub(re.escape(eatspace) + r' *', '', raw)
def mcgen(code, **kwds):
@@ -1968,7 +1968,7 @@ def parse_command_line(extra_options="",
extra_long_options=[]):
for oa in opts:
o, a = oa
if o in ("-p", "--prefix"):
- match = re.match('([A-Za-z_.-][A-Za-z0-9_.-]*)?', a)
+ match = re.match(r'([A-Za-z_.-][A-Za-z0-9_.-]*)?', a)
if match.end() != len(a):
print >>sys.stderr, \
"%s: 'funny character '%s' in argument of --prefix" \
--
2.7.4
- [Qemu-devel] [PATCH v2 for-2.9 22/47] qapi2texi: Explain enum value undocumentedness more clearly, (continued)
- [Qemu-devel] [PATCH v2 for-2.9 22/47] qapi2texi: Explain enum value undocumentedness more clearly, Markus Armbruster, 2017/03/15
- [Qemu-devel] [PATCH v2 for-2.9 34/47] qapi: Move empty doc section checking to doc parser, Markus Armbruster, 2017/03/15
- [Qemu-devel] [PATCH v2 for-2.9 14/47] qapi: Prepare for requiring more complete documentation, Markus Armbruster, 2017/03/15
- [Qemu-devel] [PATCH v2 for-2.9 42/47] qapi: enum_types is a list used like a dict, make it one, Markus Armbruster, 2017/03/15
- [Qemu-devel] [PATCH v2 for-2.9 07/47] qapi: Clean up build of generated documentation, Markus Armbruster, 2017/03/15
- [Qemu-devel] [PATCH v2 for-2.9 20/47] qapi2texi: Plainer enum value and member name formatting, Markus Armbruster, 2017/03/15
- [Qemu-devel] [PATCH v2 for-2.9 11/47] qapi: Avoid unwanted blank lines in QAPIDoc, Markus Armbruster, 2017/03/15
- [Qemu-devel] [PATCH v2 for-2.9 02/47] qapi: Make doc comments optional where we don't need them, Markus Armbruster, 2017/03/15
- [Qemu-devel] [PATCH v2 for-2.9 29/47] qapi2texi: Use category "Object" for all object types, Markus Armbruster, 2017/03/15
- [Qemu-devel] [PATCH v2 for-2.9 25/47] qapi2texi: Include member type in generated documentation, Markus Armbruster, 2017/03/15
- [Qemu-devel] [PATCH v2 for-2.9 18/47] qapi: Use raw strings for regular expressions consistently,
Markus Armbruster <=
- [Qemu-devel] [PATCH v2 for-2.9 26/47] qapi2texi: Generate reference to base type members, Markus Armbruster, 2017/03/15
- [Qemu-devel] [PATCH v2 for-2.9 28/47] qapi2texi: Generate descriptions for simple union tags, Markus Armbruster, 2017/03/15
- [Qemu-devel] [PATCH v2 for-2.9 27/47] qapi2texi: Generate documentation for variant members, Markus Armbruster, 2017/03/15
- [Qemu-devel] [PATCH v2 for-2.9 21/47] qapi2texi: Present the table of members more clearly, Markus Armbruster, 2017/03/15
- [Qemu-devel] [PATCH v2 for-2.9 24/47] qapi2texi: Implement boxed argument documentation, Markus Armbruster, 2017/03/15
- [Qemu-devel] [PATCH v2 for-2.9 33/47] qapi: Improve error message on @NAME: in free-form doc, Markus Armbruster, 2017/03/15
- [Qemu-devel] [PATCH v2 for-2.9 39/47] qapi: Drop unused variable events, Markus Armbruster, 2017/03/15
- [Qemu-devel] [PATCH v2 for-2.9 45/47] qapi: Drop unused .check_clash() parameter schema, Markus Armbruster, 2017/03/15
- [Qemu-devel] [PATCH v2 for-2.9 44/47] qapi: union_types is a list used like a dict, make it one, Markus Armbruster, 2017/03/15
- [Qemu-devel] [PATCH v2 for-2.9 40/47] qapi: Simplify what gets stored in enum_types, Markus Armbruster, 2017/03/15