Some small updates (#1486)

* Some small updates

* Update QpidException super-call to Python 3 syntax.
This commit is contained in:
Mads Jensen 2022-01-30 13:34:54 +01:00 committed by GitHub
parent 3ec6dc0fd1
commit 31a84d5b3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 10 deletions

View File

@ -61,7 +61,7 @@ to produce and consume logging messages:
from kombu import Connection
class Logger(object):
class Logger:
def __init__(self, connection, queue_name='log_queue',
serializer='json', compression=None):

View File

@ -12,7 +12,7 @@ def list_first(rs):
return rs[0] if len(rs) == 1 else None
class AsyncQueue():
class AsyncQueue:
"""Async SQS Queue."""
def __init__(self, connection=None, url=None, message_class=AsyncMessage):

View File

@ -61,7 +61,7 @@ class Request:
auth_password (str): Password for HTTP authentication.
auth_mode (str): Type of HTTP authentication (``basic`` or ``digest``).
user_agent (str): Custom user agent for this request.
network_interace (str): Network interface to use for this request.
network_interface (str): Network interface to use for this request.
on_ready (Callable): Callback to be called when the response has been
received. Must accept single ``response`` argument.
on_stream (Callable): Optional callback to be called every time body

View File

@ -12,18 +12,15 @@ class LaxBoundedSemaphore:
range even if released more times than it was acquired.
Example:
>>> from future import print_statement as printf
# ^ ignore: just fooling stupid pyflakes
>>> x = LaxBoundedSemaphore(2)
>>> x.acquire(printf, 'HELLO 1')
>>> x.acquire(print, 'HELLO 1')
HELLO 1
>>> x.acquire(printf, 'HELLO 2')
>>> x.acquire(print, 'HELLO 2')
HELLO 2
>>> x.acquire(printf, 'HELLO 3')
>>> x.acquire(print, 'HELLO 3')
>>> x._waiters # private, do not access directly
[print, ('HELLO 3',)]

View File

@ -33,7 +33,7 @@ class QpidException(Exception):
"""
def __init__(self, code=None, text=None):
super(Exception, self).__init__(self)
super().__init__(self)
self.code = code
self.text = text