Fix setup fails due to python2's encoding

This solves #11
This commit is contained in:
SuHun Han 2017-04-01 20:03:02 +09:00
parent eaac0f1130
commit 2d99780083
1 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,5 @@
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf-8 -*-
import googletrans import googletrans
import os.path import os.path
from setuptools import setup, find_packages from setuptools import setup, find_packages
@ -7,8 +8,8 @@ from setuptools import setup, find_packages
def readme(): def readme():
path = os.path.join(os.path.dirname(__file__), 'README.rst') path = os.path.join(os.path.dirname(__file__), 'README.rst')
try: try:
with open(path) as f: with open(path, 'rb') as f:
return f.read() return f.read().decode('utf8')
except IOError: except IOError:
pass pass