From 2ee14d9f003173df36bcb143cfee44f2e759dd2c Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Fri, 9 Aug 2013 17:29:47 +0100 Subject: Set long description to empty string if README not present --- setup.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 8b5e695..99ebe5a 100644 --- a/setup.py +++ b/setup.py @@ -11,8 +11,12 @@ def path_in_dir(relative_path): return os.path.join(os.path.dirname(__file__), relative_path) -def read(fname): - return open(path_in_dir(fname)).read() +def read_or_empty_string(fname): + path = path_in_dir(fname) + if os.path.exists(path): + return open(path).read() + else: + return "" jq_lib_dir = path_in_dir("_jq-lib") @@ -56,7 +60,7 @@ setup( name='jq', version='0.1.0', description='jq is a lightweight and flexible JSON processor.', - long_description=read("README"), + long_description=read_or_empty_string("README"), author='Michael Williamson', url='http://github.com/mwilliamson/jq.py', license='BSD 2-Clause', -- cgit v1.2.3