OwlCyberSecurity - MANAGER
Edit File: catch23.cpython-312.pyc
� U��g� � �� � d Z ddlmZ ddlZddlZddlmZ ej d dk( Zere e eeefZe efZ efZeefZefZne e eefZe fZ efZefZeefZdd�Zd� Zd � Zerd � Zd� Zyej2 Zd� Zy) z Python v2 to v3 migration module� )�DecimalN� )� HexLiteral� c � � t | t � r| S t rt | � S t | t � rt | � S t | t � s t | j |�� � S t | � S # t $ r t d� �w xY w)z(Initializes a bytearray from the payload)�encodingzpayload must be a str or bytes)� isinstance� bytearray�PY2�int�bytes�encode�AttributeError� ValueError)�payloadr s �n/opt/hc_python/lib64/python3.12/site-packages/../../../lib/python3.12/site-packages/mysql/connector/catch23.py�init_bytearrayr 2 s� � ��'�9�%��� ���!�!��'�3����!�!� ��� '� ?��W�^�^�X�^�>�?�?� �W���� � ?��=�>�>� ?�s �A6 �6Bc �N � t rt | t � S t | t � S )z&Returns whether a variable is a string)r r � basestring�str��objs r �isstrr F s � � ��#�z�*�*��#�s�#�#� c �N � t rt | t � S t | t � S )z/Returns whether a variable is a of unicode type)r r �unicoder r s r � isunicoder M s � � ��#�w�'�'��#�s�#�#r c � � t |t t f� rt j | t |� � S t j | |� S )zAWrapper around struct.unpack handling buffer as bytes and strings)r r r �struct�unpack_from�buffer)�fmt�bufs r � struct_unpackr$ V s; � ��c�I�u�-�.��%�%�c�6�#�;�7�7��!�!�#�s�+�+r c � � � � fd�}|S )z�Decorator used to create a abstract base class We use this decorator to create abstract base classes instead of using the abc-module. The decorator makes it possible to do the same in both Python v2 and v3 code. c �� �� | j j � }dD ] }|j |d� � | j }t r| |d<