mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-03-23 05:25:11 +00:00
qapi: Adapt to moved location of 'maketrans' function in py3
Backports commit 52c4272c6c916a53cde65b997e1a4e891c14dcef from qemu
This commit is contained in:
parent
9e0335d129
commit
74091c5976
|
@ -1740,7 +1740,10 @@ def c_enum_const(type_name, const_name, prefix=None):
|
|||
type_name = prefix
|
||||
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.
|
||||
|
|
Loading…
Reference in a new issue