Skip to content

Commit e40cba4

Browse files
Irina NicolaeIrina Nicolae
authored andcommitted
Update config parser for python2
1 parent 038cbcb commit e40cba4

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
sudo: required
22
dist: trusty
33
language: python
4-
python:
5-
- "2.7"
6-
- "3.5"
74
matrix:
85
include:
96
- python: 2.7
@@ -50,7 +47,6 @@ install:
5047
pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.1.0-cp35-cp35m-linux_x86_64.whl;
5148
fi
5249
- pip install keras
53-
# Run setup
5450
- conda install libgcc
5551
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/travis/miniconda/envs/test-environment/lib
5652

config/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@
1414

1515
config_file = join(dirname(__file__), 'config.ini')
1616
parser = cp.ConfigParser()
17-
with open(config_file, mode='rt') as f:
18-
parser.read_file(f)
17+
if sys.version_info >= (3, 0):
18+
with open(config_file, mode='rt') as f:
19+
parser.read_file(f)
20+
else:
21+
parser.read(config_file)
1922

2023
# Generate config dictionary
2124
config_dict = dict()

0 commit comments

Comments
 (0)