Warn if gnureadline isn't available when running on Darwin

This commit is contained in:
Ole André Vadla Ravnås
2015-04-29 23:05:56 +02:00
parent 34db27cd1d
commit 33fee44cdb
+12 -8
View File
@@ -4,15 +4,19 @@ def main():
from colorama import Fore, Style
import json
import platform
try:
if platform.system() == "Darwin":
# We really want to avoid libedit
HAVE_READLINE = True
if platform.system() == "Darwin":
# We really want to avoid libedit
try:
import gnureadline as readline
else:
import readline
HAVE_READLINE = True
except:
HAVE_READLINE = False
except Exception as e:
HAVE_READLINE = False
print(Fore.RED + Style.BRIGHT + """
WARNING: Unable to find package 'gnureadline' needed for tab completion;
please brace yourself for a massively degraded user experience!
""" + Style.RESET_ALL)
else:
import readline
import sys
import threading
import os