From 4045e6f2392f4be51d152583cc31d210186196e7 Mon Sep 17 00:00:00 2001 From: blink1073 Date: Sun, 12 Jan 2014 07:50:46 -0600 Subject: [PATCH 1/2] Fix troublesome import of colorama on Windows --- jedi/debug.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/jedi/debug.py b/jedi/debug.py index c6aaf7be..07a43644 100644 --- a/jedi/debug.py +++ b/jedi/debug.py @@ -1,11 +1,14 @@ from jedi._compatibility import u, encoding, is_py3k import inspect +import os import time try: - # Use colorama for nicer console output. - from colorama import Fore, init - init() + if not os.name == 'nt': + # Use colorama for nicer console output. + from colorama import Fore, init + init() + # does not work on Windows, as pyreadline and colorama interfere except ImportError: class Fore(object): RED = '' From f47d529f764be6750658a518abda3c8ea499d511 Mon Sep 17 00:00:00 2001 From: blink1073 Date: Sun, 12 Jan 2014 07:53:06 -0600 Subject: [PATCH 2/2] Allow creation of the Fore class on Windows --- jedi/debug.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jedi/debug.py b/jedi/debug.py index 07a43644..d7861021 100644 --- a/jedi/debug.py +++ b/jedi/debug.py @@ -8,7 +8,9 @@ try: # Use colorama for nicer console output. from colorama import Fore, init init() - # does not work on Windows, as pyreadline and colorama interfere + # does not work on Windows, as pyreadline and colorama interfere + else: + raise ImportError except ImportError: class Fore(object): RED = ''