diff --git a/colout/colout.py b/colout/colout.py index 3028f39..bd7a973 100755 --- a/colout/colout.py +++ b/colout/colout.py @@ -18,7 +18,6 @@ import string import hashlib import functools import argparse -import six # set the SIGPIPE handler to kill the program instead of # ending in a write error when a broken pipe occurs @@ -29,6 +28,8 @@ signal.signal( signal.SIGPIPE, signal.SIG_DFL ) # Global variable(s) ############################################################################### +PY2 = sys.version_info.major == 2 + context = {} debug = False @@ -699,7 +700,7 @@ def write(colored, stream = sys.stdout): """ Write "colored" on sys.stdout, then flush. """ - if six.PY2: # If Python 2.x: force unicode + if PY2: # If Python 2.x: force unicode if isinstance(colored, unicode): colored = colored.encode('utf-8') try: diff --git a/setup.py b/setup.py index 6af0562..787dd37 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ if sys.argv[-1] == 'publish': packages = ['colout'] -requires = ['argparse', 'pygments', 'babel'] +requires = ['argparse; python_version < "2.7"', 'pygments', 'babel'] setup( name='colout',