From 94362e903d979f21ff0768abf0c4d53367cddae7 Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Sat, 6 Dec 2014 21:15:59 +0200 Subject: [PATCH] Add clint as a dependency. Since clint 0.3, it supports Python 3. --- hy/errors.py | 44 ++++---------------------------------------- setup.py | 2 +- 2 files changed, 5 insertions(+), 41 deletions(-) diff --git a/hy/errors.py b/hy/errors.py index 439d493..5f8e562 100644 --- a/hy/errors.py +++ b/hy/errors.py @@ -21,10 +21,12 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. -from hy._compat import PY3 - import traceback +from clint.textui import colored + +from hy._compat import PY3 + class HyError(Exception): """ @@ -34,44 +36,6 @@ class HyError(Exception): pass -try: - from clint.textui import colored -except Exception: - class colored: - - @staticmethod - def black(foo): - return foo - - @staticmethod - def red(foo): - return foo - - @staticmethod - def green(foo): - return foo - - @staticmethod - def yellow(foo): - return foo - - @staticmethod - def blue(foo): - return foo - - @staticmethod - def magenta(foo): - return foo - - @staticmethod - def cyan(foo): - return foo - - @staticmethod - def white(foo): - return foo - - class HyCompileError(HyError): def __init__(self, exception, traceback=None): self.exception = exception diff --git a/setup.py b/setup.py index b357a9e..6ef918c 100755 --- a/setup.py +++ b/setup.py @@ -45,7 +45,7 @@ long_description = """Hy is a Python <--> Lisp layer. It helps make things work nicer, and lets Python and the Hy lisp variant play nice together. """ -install_requires = ['rply>=0.7.0', 'astor>=0.3'] +install_requires = ['rply>=0.7.0', 'astor>=0.3', 'clint>=0.4'] if sys.version_info[:2] < (2, 7): install_requires.append('argparse>=1.2.1') install_requires.append('importlib>=1.0.2')