Skip to content

Commit

Permalink
'os' imported but unused
Browse files Browse the repository at this point in the history
  • Loading branch information
jquast committed Sep 7, 2013
1 parent 04b61d9 commit 249dedf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions blessings/__init__.py
Expand Up @@ -9,7 +9,6 @@ class IOUnsupportedOperation(Exception):
"""A dummy exception to take the place of Python 3's
``io.UnsupportedOperation`` in Python 2"""
import os
from os import isatty, environ
from platform import python_version_tuple
import struct
import sys
Expand Down Expand Up @@ -80,10 +79,17 @@ def __init__(self, kind=None, stream=None, force_styling=False):
except IOUnsupportedOperation:
stream_descriptor = None

<<<<<<< HEAD
self._is_a_tty = (stream_descriptor is not None and
isatty(stream_descriptor))
self._does_styling = ((self.is_a_tty or force_styling) and
force_styling is not None)
=======
self.is_a_tty = (stream_descriptor is not None and
os.isatty(stream_descriptor))
self.does_styling = ((self.is_a_tty or force_styling) and
force_styling is not None)
>>>>>>> 'os' imported but unused

# The desciptor to direct terminal initialization sequences to.
# sys.__stdout__ seems to always have a descriptor of 1, even if output
Expand All @@ -97,7 +103,7 @@ def __init__(self, kind=None, stream=None, force_styling=False):
# init sequences to the stream if it has a file descriptor, and
# send them to stdout as a fallback, since they have to go
# somewhere.
setupterm(kind or environ.get('TERM', 'unknown'),
setupterm(kind or os.environ.get('TERM', 'unknown'),
self._init_descriptor)

self.stream = stream
Expand Down

0 comments on commit 249dedf

Please sign in to comment.