관리-도구
편집 파일: util.cpython-38.pyc
U ,�e� � @ s� d dl mZ d dlZd dlZd dlZd dlZd dlZd dl Z d dl Z d dlZd dlm Z d dlmZ d dlmZ d dlmZ d dlmZ dd d �dd�Zejd dd�dd��Zd d d�dd�Zd dd�dd�ZG dd� de�Zddd�dd�Zddd �d!d"�Zd#d$�d d%dd&d'�d(d)�Zd dd*d+�d,d-�Zejd.k�rtd d/lm Z d dl!Z!G d0d1� d1�Z"d#d$�d d%dd&d'�d2d3�Z#neZ#d dd�d4d5�Z$d d d6�d7d8�Z%dS )9� )�annotationsN)� TracebackType)�Any)�Callable)� Generator)� parse_shebangr �bytes)�exc�returnc C sf t �t�� t| �W 5 Q R � S Q R X t �t�� t| ��� W 5 Q R � S Q R X dt| �j� d��� S )Nz <unprintable z object>) � contextlib�suppress� TypeErrorr � Exception�str�encode�type�__name__)r � r �=/opt/hc_python/lib/python3.8/site-packages/pre_commit/util.py�force_bytes s r r zGenerator[(None, None, None)])�pathr c c s: z dV W n* t k r4 tj�| �r.t| � � Y nX dS )z2Cleans up the directory on an exceptional failure.N)� BaseException�osr �exists�rmtree)r r r r �clean_path_on_failure s r )�filenamer c C s t j�d| �S )Nzpre_commit.resources)� importlib� resources� read_text)r r r r � resource_text&