mirror of
https://github.com/qemu/qemu.git
synced 2025-08-14 20:31:47 +00:00
qapi: Adapt to moved location of 'maketrans' function in py3
Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-Id: <20180116134217.8725-6-berrange@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
5f90af8e6b
commit
52c4272c6c
@ -1734,7 +1734,10 @@ def c_enum_const(type_name, const_name, prefix=None):
|
|||||||
type_name = prefix
|
type_name = prefix
|
||||||
return camel_to_upper(type_name) + '_' + c_name(const_name, False).upper()
|
return camel_to_upper(type_name) + '_' + c_name(const_name, False).upper()
|
||||||
|
|
||||||
c_name_trans = string.maketrans('.-', '__')
|
if hasattr(str, 'maketrans'):
|
||||||
|
c_name_trans = str.maketrans('.-', '__')
|
||||||
|
else:
|
||||||
|
c_name_trans = string.maketrans('.-', '__')
|
||||||
|
|
||||||
|
|
||||||
# Map @name to a valid C identifier.
|
# Map @name to a valid C identifier.
|
||||||
|
Loading…
Reference in New Issue
Block a user