[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 15/47] qapi/common.py: Remove python compatibility workaround
From: |
John Snow |
Subject: |
[PATCH v3 15/47] qapi/common.py: Remove python compatibility workaround |
Date: |
Thu, 24 Sep 2020 20:28:28 -0400 |
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Cleber Rosa <crosa@redhat.com>
---
scripts/qapi/common.py | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index ba35abea47..cee63eb95c 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -119,10 +119,7 @@ def cgen(code, **kwds):
raw = 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(r'^(?!(#|$))', re.MULTILINE),
- indent, raw)
- raw = raw[0]
+ raw = re.sub(r'^(?!(#|$))', indent, raw, flags=re.MULTILINE)
return re.sub(re.escape(eatspace) + r' *', '', raw)
--
2.26.2
- Re: [PATCH v3 12/47] qapi: enforce import order/styling with isort, (continued)
Re: [PATCH v3 12/47] qapi: enforce import order/styling with isort, Cleber Rosa, 2020/09/29
[PATCH v3 10/47] qapi: Prefer explicit relative imports, John Snow, 2020/09/24
[PATCH v3 13/47] qapi: delint using flake8, John Snow, 2020/09/24
[PATCH v3 05/47] qapi/doc.py: Change code templates from function to string, John Snow, 2020/09/24
[PATCH v3 15/47] qapi/common.py: Remove python compatibility workaround,
John Snow <=
[PATCH v3 20/47] qapi/common.py: add type hint annotations, John Snow, 2020/09/24
[PATCH v3 17/47] qapi/common.py: delint with pylint, John Snow, 2020/09/24
[PATCH v3 14/47] qapi: add pylintrc, John Snow, 2020/09/24
[PATCH v3 24/47] qapi/events.py: add type hint annotations, John Snow, 2020/09/24
[PATCH v3 19/47] qapi/common.py: check with pylint, John Snow, 2020/09/24
[PATCH v3 23/47] qapi: establish mypy type-checking baseline, John Snow, 2020/09/24
[PATCH v3 33/47] qapi/gen.py: Enable checking with mypy, John Snow, 2020/09/24
[PATCH v3 25/47] qapi/events.py: Move comments into docstrings, John Snow, 2020/09/24
[PATCH v3 16/47] qapi/common.py: Add indent manager, John Snow, 2020/09/24