StringIO is bad m'kay (python3 this and that)

This commit is contained in:
Miroslav Stampar
2019-03-26 14:37:01 +01:00
parent 4b75ca15e8
commit 8d89389c36
9 changed files with 23 additions and 26 deletions

View File

@@ -13,9 +13,9 @@ finally:
import pickle as picklePy
import base64
import io
import json
import re
import StringIO
import sys
from lib.core.settings import IS_WIN
@@ -84,7 +84,7 @@ def base64unpickle(value, unsafe=False):
self.load_reduce()
def loads(str):
f = StringIO.StringIO(str)
f = io.BytesIO(str)
if unsafe:
unpickler = picklePy.Unpickler(f)
unpickler.dispatch[picklePy.REDUCE] = _