From f347b0decaa981f415bf49d121deecd6e93c1586 Mon Sep 17 00:00:00 2001 From: Manuel Ebert Date: Fri, 27 Jun 2014 15:56:12 +0200 Subject: [PATCH] Installs readline on non-windows if not available Fixes #208 --- setup.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 14380949..72cf6f97 100644 --- a/setup.py +++ b/setup.py @@ -44,6 +44,12 @@ except ImportError: import os import sys import re +try: + import readline + readline_available = True +except ImportError: + readline_available = False + if sys.argv[-1] == 'publish': os.system("python setup.py sdist upload") @@ -60,11 +66,13 @@ def get_version(filename="jrnl/__init__.py"): return m.group(1) conditional_dependencies = { - "pyreadline>=2.0": "win32" in sys.platform, + "pyreadline>=2.0": not readline_available and "win32" in sys.platform, + "readline>=6.2": not readline_available and "win32" not in sys.platform, "colorama>=0.2.5": "win32" in sys.platform, "argparse>=1.1.0": sys.version.startswith("2.6") } + setup( name = "jrnl", version = get_version(),