This document describes the current stable version of py-amqp (2.2). For development docs, go here.

amqp.utils

Compatibility utilities.

class amqp.utils.NullHandler(level=0)[source]

A logging handler that does nothing.

emit(record)[source]
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.