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:
Markus Armbruster 2020-03-04 16:59:30 +01:00
parent baa310f1bb
commit ed39c03e2f
4 changed files with 4 additions and 20 deletions

View file

@ -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.