mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-08 15:05:15 +02:00
[unicode] error in setup
This commit is contained in:
parent
6fba6acc2b
commit
0e1816da44
1 changed files with 8 additions and 2 deletions
10
setup.py
10
setup.py
|
|
@ -42,7 +42,13 @@ import numpy as np
|
|||
|
||||
|
||||
def read(fname):
|
||||
return open(os.path.join(os.path.dirname(__file__), fname)).read()
|
||||
try:
|
||||
with open(os.path.join(os.path.dirname(__file__), fname)) as f:
|
||||
return unicode(f.read())
|
||||
except NameError:
|
||||
#python 3
|
||||
with open(os.path.join(os.path.dirname(__file__), fname)) as f:
|
||||
return (f.read())
|
||||
|
||||
def read_to_rst(fname):
|
||||
try:
|
||||
|
|
@ -50,7 +56,7 @@ def read_to_rst(fname):
|
|||
#print 'Warning in installation: For rst formatting in pypi, consider installing pypandoc for conversion'
|
||||
with open('README.rst', 'w') as f:
|
||||
f.write(pypandoc.convert('README.md', 'rst'))
|
||||
except:
|
||||
except ImportError:
|
||||
return read(fname)
|
||||
|
||||
version_dummy = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue