buffer() was removed in Python 3 so use bytes (#1218)

* buffer() was removed in Python 3 so use memoryview

https://docs.python.org/2.7/library/stdtypes.html#memoryview-type

* buffer = bytes on Python 3

* from kombu.five import buffer

* buffer --> buffer_t

* @patch('buffer_t') in test_qpid.py

* @patch('kombu.five.buffer_t')

* Use buffer on legacy Python and bytes on Python

* Update test_qpid.py
This commit is contained in:
Christian Clauss 2020-07-28 16:20:14 +02:00 committed by GitHub
parent b4581289fa
commit ed35d9f0a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -124,6 +124,10 @@ from kombu.transport import base, virtual
logger = get_logger(__name__)
try:
buffer
except NameError:
buffer = bytes
OBJECT_ALREADY_EXISTS_STRING = 'object already exists'