Skip to content
Snippets Groups Projects
Commit 5f90af8e authored by Daniel P. Berrangé's avatar Daniel P. Berrangé Committed by Eduardo Habkost
Browse files

qapi: adapt to moved location of StringIO module in py3


Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
Message-Id: <20180116134217.8725-5-berrange@redhat.com>
Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
parent 38710a89
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,10 @@
from collections import OrderedDict
except:
from ordereddict import OrderedDict
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
builtin_types = {
'null': 'QTYPE_QNULL',
......@@ -1995,8 +1999,7 @@ def maybe_open(really, name, opt):
if really:
return open(name, opt)
else:
import StringIO
return StringIO.StringIO()
return StringIO()
fdef = maybe_open(do_c, c_file, 'w')
fdecl = maybe_open(do_h, h_file, 'w')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment