fixed StringIO import to compability with python3