This document is for py-amqp's development version, which can be significantly different from previous releases. Get the stable docs here: 2.4.

amqp.utils

Compatibility utilities.

amqp.utils.bytes_to_str(s)[source]

Convert bytes to str.

amqp.utils.coro(gen)[source]

Decorator to mark generator as a co-routine.

amqp.utils.get_errno(exc)[source]

Get exception errno (if set).

Notes:

socket.error and IOError first got the .errno attribute in Py2.7.

amqp.utils.get_logger(logger)[source]

Get logger by name.

amqp.utils.set_cloexec(fd, cloexec)[source]

Set flag to close fd after exec.

amqp.utils.str_to_bytes(s)[source]

Convert str to bytes.