qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 5/5] qapi: Adapt to moved location of 'maketrans'


From: Daniel P. Berrange
Subject: [Qemu-devel] [PATCH v2 5/5] qapi: Adapt to moved location of 'maketrans' function in py3
Date: Thu, 31 Aug 2017 15:24:30 +0100

Signed-off-by: Daniel P. Berrange <address@hidden>
---
 scripts/qapi.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/qapi.py b/scripts/qapi.py
index 3c06711e2c..853622badd 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -1743,7 +1743,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.
-- 
2.13.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]