setup.py: ignore README.rst if not exist

This commit is contained in:
Mort Yao 2014-09-21 04:39:07 +02:00
parent 8e27c35586
commit b0cb4acee2

View File

@ -8,7 +8,10 @@ PROJ_METADATA = '%s.json' % PROJ_NAME
import os, json, imp
here = os.path.abspath(os.path.dirname(__file__))
proj_info = json.loads(open(os.path.join(here, PROJ_METADATA), encoding='utf-8').read())
README = open(os.path.join(here, 'README.rst'), encoding='utf-8').read()
try:
README = open(os.path.join(here, 'README.rst'), encoding='utf-8').read()
except:
README = ""
CHANGELOG = open(os.path.join(here, 'CHANGELOG.rst'), encoding='utf-8').read()
VERSION = imp.load_source('version', os.path.join(here, 'src/%s/version.py' % PACKAGE_NAME)).__version__