Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit 6b5cfa4

Browse files
committed
[travis] Fixing import error in travis
in python2, encoding is not taken as an argument to open()
1 parent be54b69 commit 6b5cfa4

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ python:
44
- "3.4"
55

66
install:
7-
- "pip install ."
87
- "pip install -r requirements.txt"
8+
- "pip install ."
99

1010
notifications:
1111
webhooks:

setup.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@
1515
here = path.abspath(path.dirname(__file__))
1616

1717
# get the dependencies and installs
18-
with open(path.join(here, 'requirements.txt'), encoding='utf-8') as f:
19-
all_reqs = f.read().split('\n')
18+
if sys.version_info[:2] <= (2, 7):
19+
with open(path.join(here, 'requirements.txt')) as f:
20+
all_reqs = f.read().split('\n')
21+
else:
22+
with open(path.join(here, 'requirements.txt'), encoding='utf-8') as f:
23+
all_reqs = f.read().split('\n')
2024

2125
install_requires = [x.strip() for x in all_reqs if 'git+' not in x]
2226
dependency_links = [x.strip().replace('git+', '') for x in all_reqs if 'git+' not in x]

0 commit comments

Comments
 (0)