관리-도구
편집 파일: catch23.cpython-38.pyc
U )�e� � @ s� d Z ddlmZ ddlZddlZddlmZ ejd dkZerje e eeefZe efZ efZeefZefZn&e e eefZe fZ efZefZeefZdd d �Zdd� Zd d� Zer�dd� ZnejZdd� ZdS )z Python v2 to v3 migration module� )�DecimalN� )� HexLiteral� � �utf-8c C sn t | t�r| S trt| �S t | t�r,t| �S t | t�sfzt| j|d��W S tk rd td��Y nX t| �S )z(Initializes a bytearray from the payload)�encodingzpayload must be a str or bytes)� isinstance� bytearray�PY2�int�bytes�encode�AttributeError� ValueError)�payloadr � r �l/opt/hc_python/lib64/python3.8/site-packages/../../../lib/python3.8/site-packages/mysql/connector/catch23.py�init_bytearray2 s r c C s t rt| t�S t| t�S dS )z&Returns whether a variable is a stringN)r r � basestring�str��objr r r �isstrF s r c C s t rt| t�S t| t�S dS )z/Returns whether a variable is a of unicode typeN)r r �unicoder r r r r � isunicodeM s r c C s* t |ttf�rt�| t|��S t�| |�S )zAWrapper around struct.unpack handling buffer as bytes and strings)r r r �struct�unpack_from�buffer)�fmt�bufr r r � struct_unpackV s r! c s � fdd�}|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 sL | j �� }dD ]}|�|d� q| j}tr4| |d<