qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>,
	Michael Roth <mdroth@linux.vnet.ibm.com>,
	"Daniel P. Berrange" <berrange@redhat.com>
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	[thread overview]
Message-ID: <20170831142430.16665-6-berrange@redhat.com> (raw)
In-Reply-To: <20170831142430.16665-1-berrange@redhat.com>

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
 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

  parent reply	other threads:[~2017-08-31 14:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-31 14:24 [Qemu-devel] [PATCH v2 0/5] qapi: support py2 & py3 in parallel Daniel P. Berrange
2017-08-31 14:24 ` [Qemu-devel] [PATCH v2 1/5] qapi: convert to use python print function instead of statement Daniel P. Berrange
2017-08-31 14:24 ` [Qemu-devel] [PATCH v2 2/5] qapi: use items()/values() intead of iteritems()/itervalues() Daniel P. Berrange
2017-08-31 14:24 ` [Qemu-devel] [PATCH v2 3/5] qapi: Use OrderedDict from standard library if available Daniel P. Berrange
2017-08-31 16:02   ` Eric Blake
2017-08-31 14:24 ` [Qemu-devel] [PATCH v2 4/5] qapi: adapt to moved location of StringIO module in py3 Daniel P. Berrange
2017-08-31 14:24 ` Daniel P. Berrange [this message]
2017-09-08  9:33 ` [Qemu-devel] [PATCH v2 0/5] qapi: support py2 & py3 in parallel Markus Armbruster
2017-09-08  9:40   ` Daniel P. Berrange
2017-09-08 14:51     ` David Michael

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170831142430.16665-6-berrange@redhat.com \
    --to=berrange@redhat.com \
    --cc=armbru@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).