mirror of
https://github.com/jlu5/PyLink.git
synced 2025-01-26 12:14:24 +01:00
setup.py: work around installation error on Python 3.4
This commit is contained in:
parent
9cf507183d
commit
c91b5f74ea
10
setup.py
10
setup.py
@ -30,8 +30,14 @@ with open('__init__.py', 'w') as f:
|
|||||||
f.write('real_version = %r\n' % real_version)
|
f.write('real_version = %r\n' % real_version)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open('README.md') as f:
|
if sys.version_info >= (3, 5):
|
||||||
long_description = f.read()
|
with open('README.md') as f:
|
||||||
|
long_description = f.read()
|
||||||
|
else:
|
||||||
|
# Work around "TypeError: a bytes-like object is required, not 'str'" errors on Python 3.4
|
||||||
|
# when the README has Unicode characters (error in distutils.util.rfc822_escape)
|
||||||
|
import codecs
|
||||||
|
long_description = codecs.open('README.md', encoding='utf-8').read()
|
||||||
except OSError:
|
except OSError:
|
||||||
print('WARNING: Failed to read readme, skipping writing long_description')
|
print('WARNING: Failed to read readme, skipping writing long_description')
|
||||||
long_description = None
|
long_description = None
|
||||||
|
Loading…
Reference in New Issue
Block a user