Skip to content

Commit

Permalink
Removing future imports from setup.py, conditional pickle load in tes…
Browse files Browse the repository at this point in the history
…t_cartpole
  • Loading branch information
anandtrex committed Oct 19, 2017
1 parent 0aec612 commit 6fb57f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
10 changes: 2 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@
(https://github.com/pydata/pandas) which have been permitted for use under the
BSD license.
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import open
from future import standard_library
standard_library.install_aliases()
import sys
import glob
import multiprocessing
Expand Down Expand Up @@ -266,7 +259,8 @@ def no_cythonize(extensions, **_ignore):
'joblib',
'hyperopt',
'pymongo',
'cairocffi'
'cairocffi',
'future'
],
setup_requires=['numpy >= 1.7'],
ext_modules=extensions,
Expand Down
6 changes: 5 additions & 1 deletion tests/test_cartpole.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from nose.tools import eq_
from rlpy.Tools import __rlpy_location__
import os
import sys


def test_cartpole():
Expand All @@ -37,7 +38,10 @@ def test_cartpole():

def check_traj(domain_class, filename):
with open(filename, 'rb') as f:
traj = pickle.load(f, encoding='latin1')
if not sys.version_info[:2] == (2, 7):
traj = pickle.load(f, encoding='latin1')
else:
traj = pickle.load(f)
traj_now = sample_random_trajectory(domain_class)
for i, e1, e2 in zip(list(range(len(traj_now))), traj_now, traj):
print(i)
Expand Down

0 comments on commit 6fb57f2

Please sign in to comment.