diff options
author | John Snow | 2020-10-09 18:15:32 +0200 |
---|---|---|
committer | Markus Armbruster | 2020-10-10 11:37:47 +0200 |
commit | 341f6afbac5afb41eb3291a060332f92bbb0f9c7 (patch) | |
tree | 7744f49a856d2e90d81ff1399fe657c7c25d6227 /scripts/qapi | |
parent | qapi: add pylintrc (diff) | |
download | qemu-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/qapi')
-rw-r--r-- | scripts/qapi/common.py | 5 |
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) |