From 33fee44cdbb87d90c5f07ed93c2f3f62bfc34f73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Andr=C3=A9=20Vadla=20Ravn=C3=A5s?= Date: Wed, 29 Apr 2015 23:05:56 +0200 Subject: [PATCH] Warn if gnureadline isn't available when running on Darwin --- src/frida/repl.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/frida/repl.py b/src/frida/repl.py index 85c7887..0f43cc7 100644 --- a/src/frida/repl.py +++ b/src/frida/repl.py @@ -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