mirror of
https://github.com/mii443/qemu.git
synced 2025-08-23 23:49:36 +00:00
qapi: Drop conditionals for Python 2
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20200304155932.20452-3-armbru@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
This commit is contained in:
@ -12,7 +12,6 @@
|
||||
# See the COPYING file in the top-level directory.
|
||||
|
||||
import re
|
||||
import string
|
||||
|
||||
|
||||
# ENUMName -> ENUM_NAME, EnumName1 -> ENUM_NAME1
|
||||
@ -43,10 +42,7 @@ def c_enum_const(type_name, const_name, prefix=None):
|
||||
return camel_to_upper(type_name) + '_' + c_name(const_name, False).upper()
|
||||
|
||||
|
||||
if hasattr(str, 'maketrans'):
|
||||
c_name_trans = str.maketrans('.-', '__')
|
||||
else:
|
||||
c_name_trans = string.maketrans('.-', '__')
|
||||
c_name_trans = str.maketrans('.-', '__')
|
||||
|
||||
|
||||
# Map @name to a valid C identifier.
|
||||
|
Reference in New Issue
Block a user