diff --git a/clint/pipes.py b/clint/pipes.py index 713e914..de7ba28 100644 --- a/clint/pipes.py +++ b/clint/pipes.py @@ -9,6 +9,7 @@ This module contains the helper functions for dealing with unix pipes. """ from __future__ import absolute_import +from __future__ import with_statement import sys diff --git a/clint/resources.py b/clint/resources.py index 996d435..27ad10a 100644 --- a/clint/resources.py +++ b/clint/resources.py @@ -10,6 +10,7 @@ This module contains all the application resource features of clint. from __future__ import absolute_import +from __future__ import with_statement import errno from os import remove, removedirs diff --git a/clint/textui/__init__.py b/clint/textui/__init__.py index d260ede..aa3a36a 100644 --- a/clint/textui/__init__.py +++ b/clint/textui/__init__.py @@ -8,8 +8,6 @@ This module provides the text output helper system. """ -from __future__ import absolute_import - from . import colored -from .core import * +from core import * diff --git a/clint/utils.py b/clint/utils.py index 4d1257b..3f499d0 100644 --- a/clint/utils.py +++ b/clint/utils.py @@ -9,6 +9,7 @@ Various Python helpers used within clint. """ from __future__ import absolute_import +from __future__ import with_statement import sys import errno @@ -28,7 +29,7 @@ def mkdir_p(path): """Emulates `mkdir -p` behavior.""" try: makedirs(path) - except OSError as exc: # Python >2.5 + except OSError, exc: # Python >2.5 if exc.errno == errno.EEXIST: pass else: diff --git a/examples/colors_indent.py b/examples/colors_indent.py index c899fac..f5638ad 100755 --- a/examples/colors_indent.py +++ b/examples/colors_indent.py @@ -1,6 +1,9 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +from __future__ import with_statement + + import sys import os diff --git a/examples/indents.py b/examples/indents.py index 087fa20..434dd6a 100755 --- a/examples/indents.py +++ b/examples/indents.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +from __future__ import with_statement + import sys import os diff --git a/examples/newline_indent.py b/examples/newline_indent.py index c3eec18..033dc32 100755 --- a/examples/newline_indent.py +++ b/examples/newline_indent.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +from __future__ import with_statement + import sys import os diff --git a/examples/piped.py b/examples/piped.py index 2aa1856..63701d4 100644 --- a/examples/piped.py +++ b/examples/piped.py @@ -4,6 +4,8 @@ import sys import os +from __future__ import with_statement + sys.path.insert(0, os.path.abspath('..')) from clint import piped_in