a lj- @ 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 deZ"ee# e#e$dd dZ%e j&d&e'ed dddZ(e'dddZ)G dd dej*Z+e,e e,ge,f dddZ-G dd dej.Z/G dd dej0j1Z2G dd d eZ3G d!d" d"eZ4e'e$ee, e'd#d$d%Z5dS )' N)Filter)IOAnyCallableIteratorOptionalTextIOTypecast)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 ) exc_classexcreturnc C s0 | t u rdS tsdS t|to.|jtjtjfv S )NTF)BrokenPipeErrorr isinstanceOSErrorerrnoEINVALZEPIPE)r r r r r _is_broken_pipe_error' s r )numr 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_stateindentation)r" r r r indent_log4 s r&