Update StringIO usage for Python 3 (#20462)

This commit is contained in:
Jeremy Bowman
2019-05-08 12:13:22 -04:00
committed by GitHub
parent e946acae01
commit 47292e5f92
7 changed files with 30 additions and 33 deletions

View File

@@ -1,9 +1,9 @@
"""Models for the util app. """
from __future__ import absolute_import
import cStringIO
import gzip
import logging
from io import BytesIO
import six
from config_models.models import ConfigurationModel
@@ -37,7 +37,7 @@ def decompress_string(value):
try:
val = value.encode('utf').decode('base64')
zbuf = cStringIO.StringIO(val)
zbuf = BytesIO(val)
zfile = gzip.GzipFile(fileobj=zbuf)
ret = zfile.read()
zfile.close()