from __future__ import absolute_import
import dummy_threading as threading
from pip.compat import WINDOWS
from pip.utils import ensure_dir
from pip._vendor import colorama
# Lots of different errors can come from this, including SystemError and
_log_state = threading.local()
_log_state.indentation = 0
@contextlib.contextmanager
A context manager which will cause the log output to be indented for any
log messages emitted inside it.
_log_state.indentation += num
_log_state.indentation -= num
return getattr(_log_state, 'indentation', 0)