Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
_util.cpython-313.pyc53 linesDownload Raw Back to __pycache__
1�

2��jl���%SSKJr SSKrSSKrSSKrSSKJrJrJrJ	r	 SSK3Jr \RS:�a$\	\
\\R\
\R\4rO\	\
\\R4r\"5r\R$r\R&rS\S'\R+SS	9rSS4jrSSjrSSjrSS
jrSSjr\"5rSrSSjrg)�)�annotationsN)�Any�Callable�NoReturn�Union)�Binding)��	r�libF)�should_clear_after_allocc�Z�U(dg[RU5RS5$)z�5Get a native string type representing of the given CFFI ``char*`` object.6 7:param charp: A C-style string represented using CFFI.8 9:return: :class:`str`10��utf-8)�ffi�string�decode)�charps �SD:\code\apps\devtools\python\user_packages\Python313\site-packages\OpenSSL/_util.py�textrs$�����:�:�e��#�#�G�,�,�c	�"�/n[R5nUS:XaOjUR[[R	U55[[RU55[[R
U5545 M�U"U5e)aK11Convert an OpenSSL library failure into a Python exception.12 13When a call to the native OpenSSL library fails, this is usually signalled14by the return value, and an error code is stored in an error queue15associated with the current thread. The err library provides functions to16obtain these error codes and textual error messages.17r)r�
ERR_get_error�appendr�ERR_lib_error_string�ERR_func_error_string�ERR_reason_error_string)�exception_type�errors�errors   r�exception_from_error_queuer 's����F�18��!�!�#���A�:���
�
��S�-�-�e�4�5��S�.�.�u�5�6��S�0�0��7�8�
�	19�	���20 � rc�^�SU4SjjnU$)zr21Create an assert function that uses :func:`exception_from_error_queue` to22raise an exception wrapped by *error*.23c�(>�USLa[T5 gg)zD24If *ok* is not True, retrieve the error from OpenSSL and raise it.25TN)r )�okrs �r�openssl_assert�#make_assert.<locals>.openssl_assertGs����T�>�&�u�-�r)r#�bool�return�None�)rr$s` r�make_assertr*As���.��rc��[R"U5n[U[5(a$UR	[26R"55$U$)z�27Convert a Python path to a :py:class:`bytes` for the path which can be28passed into an OpenSSL API accepting a filename.29 30:param s: A path (valid for os.fspath).31 32:return: An instance of :py:class:`bytes`.33)�os�fspath�34isinstance�str�encode�sys�getfilesystemencoding)�s�bs  r�35path_bytesr5Qs;��	�	�	�!��A��!�S����x�x��1�1�3�4�4��rc�$�URS5$)N�charmap)r0)r3s r�byte_stringr8bs���8�8�I��rz,str for {0} is no longer accepted, use bytesc��[U[5(a>[R"[RU5[SS9 URS5$U$)a�36If ``obj`` is text, emit a warning that it should be bytes instead and try37to convert it to bytes automatically.38 39:param str label: The name of the parameter from which ``obj`` was taken40    (so a developer can easily find the source of the problem and correct41    it).42 43:return: If ``obj`` is the text string type, a ``bytes`` object giving the44    UTF-8 encoding of that text is returned.  Otherwise, ``obj`` itself is45    returned.46r	)�category�47stacklevelr)r.r/�warnings�warn�
_TEXT_WARNING�format�DeprecationWarningr0)�label�objs  r�text_to_bytes_and_warnrCmsG���#�s����
�
�� � ��'�'��	48�49�z�z�'�"�"��Jr)rrr'r/)r�type[Exception]r'r)rrDr'zCallable[[bool], Any])r3�StrOrBytesPathr'�bytes)r3r/r'rF)rAr/rBrr'r) �50__future__rr,r1r<�typingrrrr�,cryptography.hazmat.bindings.openssl.bindingr�version_infor/rF�PathLikerE�bindingrr�__annotations__�
new_allocator�no_zero_allocatorrr r*r5r8�object�UNSPECIFIEDr>rCr)rr�<module>rRs���"�	�51��1�1�@����v���3��r�{�{�3�'7����U�9K�K�L�N��3��r�{�{�2�3�N�52�)��
�k�k���;�;��S���%�%�u�%�E��53-�!�4
� �"��h��>�
�r
codekingpro/portable-devtools · Team Ai