From ed39c03e2f67e9dcc0b68a9740f73b79d252b76b Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 4 Mar 2020 16:59:30 +0100 Subject: qapi: Drop conditionals for Python 2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200304155932.20452-3-armbru@redhat.com> Reviewed-by: John Snow --- scripts/qapi/common.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'scripts/qapi/common.py') diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py index e00dcafce7..ba35abea47 100644 --- a/scripts/qapi/common.py +++ b/scripts/qapi/common.py @@ -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. -- cgit 1.4.1