HEX
Server: LiteSpeed
System: Linux s787.bom1.mysecurecloudhost.com 4.18.0-477.13.1.lve.el8.x86_64 #1 SMP Thu Jun 1 16:40:47 EDT 2023 x86_64
User: mobilech (5348)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/git/__pycache__/compat.cpython-310.pyc
o

;j��@s�UdZddlZddlZddlZddlZddlmZmZddlm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZejdkejdkejdkd�Zd	ed
e	fdd�ZesQeZd
e
efd
d�Zeed<	eed<	eed<	e��Z	eddd��Zede
d
efdd��Zdee
dfd
eefdd�Zeddd��Z ede
d
e!fdd��Z dee
d
ee!fdd�Z eddd��Z"ede
d
e!fdd��Z"dee
d
ee!fdd�Z"dS) aCUtilities to help provide compatibility with Python 3.

This module exists for historical reasons. Code outside GitPython may make use of public
members of this module, but is unlikely to benefit from doing so. GitPython continues to
use some of these utilities, in some cases for compatibility across different platforms.
�N)�force_bytes�
force_text)�Any�AnyStr�Dict�IO�List�Optional�
TYPE_CHECKING�Tuple�Type�Union�overload�nt�posix�darwin)�is_win�is_posix�	is_darwin�name�returncCsRzt|}Wntytdt�d|���d�wtjt�d|�d�tdd�|S)Nzmodule z has no attribute �.zt and other is_<platform> aliases are deprecated. Write the desired os.name or sys.platform check explicitly instead.�)�
stacklevel)�_deprecated_platform_aliases�KeyError�AttributeError�__name__�warnings�warn�DeprecationWarning)r�value�r"�>/opt/saltstack/salt/lib/python3.10/site-packages/git/compat.py�_getattr.s��r$cCsgt��t�S�N)�globalsrr"r"r"r#�__dir__Asr'rrr�scC�dSr%r"�r(r"r"r#�safe_decodem�r+cCr)r%r"r*r"r"r#r+qr,cCs>t|t�r|St|t�r|�td�S|durdStd|f��)z)Safely decode a binary string to Unicode.�surrogateescapeN�"Expected bytes or text, but got %r)�
isinstance�str�bytes�decode�defenc�	TypeErrorr*r"r"r#r+us

cCr)r%r"r*r"r"r#�safe_encode�r,r5cCr)r%r"r*r"r"r#r5�r,cCs<t|t�r
|�t�St|t�r|S|durdStd|f��)z)Safely encode a binary string to Unicode.Nr.)r/r0�encoder3r1r4r*r"r"r#r5�s


cCr)r%r"r*r"r"r#�
win_encode�r,r7cCr)r%r"r*r"r"r#r7�r,cCsBt|t�r
|�t�d��St|t�r|S|durtd|f��dS)z8Encode Unicode strings for process arguments on Windows.FNr.)r/r0r6�locale�getpreferredencodingr1r4r*r"r"r#r7�s

)r(NrN)#�__doc__r8�os�sysrZgitdb.utils.encodingrr�typingrrrrrr	r
rrr
rr�platformrr0r$�__getattr__r'�bool�__annotations__�getfilesystemencodingr3r+r5r1r7r"r"r"r#�<module>sL4�