summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJohn Snow2020-10-09 18:15:32 +0200
committerMarkus Armbruster2020-10-10 11:37:47 +0200
commit341f6afbac5afb41eb3291a060332f92bbb0f9c7 (patch)
tree7744f49a856d2e90d81ff1399fe657c7c25d6227 /scripts
parentqapi: add pylintrc (diff)
downloadqemu-341f6afbac5afb41eb3291a060332f92bbb0f9c7.tar.gz
qemu-341f6afbac5afb41eb3291a060332f92bbb0f9c7.tar.xz
qemu-341f6afbac5afb41eb3291a060332f92bbb0f9c7.zip
qapi/common.py: Remove python compatibility workaround
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20201009161558.107041-11-jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/qapi/common.py5
1 files changed, 1 insertions, 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)