summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2013-08-09 17:29:47 +0100
committerMichael Williamson <mike@zwobble.org>2013-08-09 17:29:47 +0100
commit2ee14d9f003173df36bcb143cfee44f2e759dd2c (patch)
tree6dd8d9c8f8955155bf9c07aa4923944128763245
parentcbfbd9be6b47a5822a3b3cd5ec9f19a82496630e (diff)
Set long description to empty string if README not present
-rw-r--r--setup.py10
1 files changed, 7 insertions, 3 deletions
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',