mirror of https://gitee.com/openkylin/qemu.git
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>
This commit is contained in:
parent
e6522d889a
commit
341f6afbac
|
@ -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)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue