File: //opt/alt/python37/lib/python3.7/site-packages/bmemcached/__pycache__/utils.cpython-37.pyc
B
��f% � @ s d dl Z dZdd� ZdS )� N)�str_to_bytesc C s$ t | tj�s t | tj�r | �� S | S )aQ
Simply convert a string type to bytes if the value is a string
and is an instance of six.string_types but not of six.binary_type
in python2 struct.pack("<Q") is both string_types and binary_type but
in python3 struct.pack("<Q") is binary_type but not a string_types
:param value:
:param binary:
:return:
)�
isinstance�six�binary_type�string_types�encode)�value� r �A/opt/alt/python37/lib/python3.7/site-packages/bmemcached/utils.pyr s
r )r �__all__r r r r r
�<module> s