File: //lib/python3.9/site-packages/pip/_internal/utils/__pycache__/logging.cpython-39.pyc
a
g��e80 � @ s� d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZ d dlmZm Z m
Z
mZmZm
Z
mZmZ d dlmZmZ d dlmZ d dlmZ d dlmZ zd dlZW n ey� d dlZY n0 zd dlmZ W n ey� dZY n0 e�� Z ed �Z!G d
d� de�Z"e�rdd
� Z#ndd
� Z#e j$d"dd��Z%dd� Z&G dd� dej'�Z(dd� Z)G dd� dej*�Z+G dd� dej,j-�Z.G dd� de�Z/G dd� de�Z0d d!� Z1dS )#� N)�Filter)�IO�Any�Callable�Iterator�Optional�TextIO�Type�cast)�VERBOSE� getLogger)�WINDOWS)�DEPRECATION_MSG_PREFIX)�
ensure_dir)�coloramazpip.subprocessorc @ s e Zd ZdZdS )�BrokenStdoutLoggingErrorzO
Raised if BrokenPipeError occurs for the stdout stream while logging.
N)�__name__�
__module__�__qualname__�__doc__� r r �?/usr/lib/python3.9/site-packages/pip/_internal/utils/logging.pyr ! s r c C s$ | t u p"t|t�o"|jtjtjfv S )z(See the docstring for non-Windows below.)�BrokenPipeError�
isinstance�OSError�errno�EINVALZEPIPE�� exc_class�excr r r �_is_broken_pipe_error. s �r c C s | t u S )z�
Return whether an exception is a broken pipe error.
Args:
exc_class: an exception class.
exc: an exception instance.
)r r r r r r 8 s � c c sD t � t_t j| 7 _zdV W t j| 8 _nt j| 8 _0 dS )zv
A context manager which will cause the log output to be indented for any
log messages emitted inside it.
N)�get_indentation�
_log_state�indentation)Znumr r r �
indent_logD s
r% c C s t tdd�S )Nr$ r )�getattrr# r r r r r"