Fix Python3 compat of import dependencies

This commit is contained in:
Jonas Schneider
2016-04-27 18:03:29 -07:00
parent 7d2630b82e
commit 5065950a09
11 changed files with 48 additions and 41 deletions

View File

@@ -3,7 +3,7 @@ from gym.spaces import Discrete, Tuple
from gym.utils import colorize
import numpy as np
import random
import StringIO
from six import StringIO
import sys
import math
@@ -91,7 +91,7 @@ class AlgorithmicEnv(Env):
# Nothing interesting to close
return
outfile = StringIO.StringIO() if mode == 'ansi' else sys.stdout
outfile = StringIO() if mode == 'ansi' else sys.stdout
inp = "Total length of input instance: %d, step: %d\n" % (self.total_len, self.time)
outfile.write(inp)
x, y, action = self.x, self.y, self.last_action