summaryrefslogtreecommitdiffstats
path: root/scripts/qapi/common.py
diff options
context:
space:
mode:
authorPeter Maydell2020-03-05 16:18:18 +0100
committerPeter Maydell2020-03-05 16:18:19 +0100
commitaf4378c39e54705d9b585089de80aae9526ac7e7 (patch)
tree18c532a6f6dfb1de4ddfa0ee1300ff5ce8c5e44c /scripts/qapi/common.py
parentMerge remote-tracking branch 'remotes/stsquad/tags/pull-testing-040320-1' int... (diff)
parentqapi: Brush off some (py)lint (diff)
downloadqemu-af4378c39e54705d9b585089de80aae9526ac7e7.tar.gz
qemu-af4378c39e54705d9b585089de80aae9526ac7e7.tar.xz
qemu-af4378c39e54705d9b585089de80aae9526ac7e7.zip
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2020-03-05' into staging
QAPI patches for 2020-03-05 # gpg: Signature made Thu 05 Mar 2020 12:42:15 GMT # gpg: using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653 # gpg: issuer "armbru@redhat.com" # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full] # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" [full] # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * remotes/armbru/tags/pull-qapi-2020-03-05: qapi: Brush off some (py)lint qapi: Use super() now we have Python 3 qapi: Drop conditionals for Python 2 qapi: Inheriting from object is pointless with Python 3, drop Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'scripts/qapi/common.py')
-rw-r--r--scripts/qapi/common.py6
1 files changed, 1 insertions, 5 deletions
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.