Use logging.Logger.warning (#2058)

Usage of `logging.Logger.warn` was deprecated since Python 3.3 and it
will be removed in Python 3.13:
https://docs.python.org/3.13/whatsnew/3.13.html#logging
This commit is contained in:
Roman Inflianskas 2024-07-12 19:13:50 +03:00 committed by GitHub
parent f61c6d1726
commit d4d9012863
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -89,7 +89,7 @@ except ImportError: # pragma: no cover
logger = get_logger('kombu.transport.redis') logger = get_logger('kombu.transport.redis')
crit, warn = logger.critical, logger.warn crit, warning = logger.critical, logger.warning
DEFAULT_PORT = 6379 DEFAULT_PORT = 6379
DEFAULT_DB = 0 DEFAULT_DB = 0
@ -939,8 +939,8 @@ class Channel(virtual.Channel):
try: try:
message = loads(bytes_to_str(payload['data'])) message = loads(bytes_to_str(payload['data']))
except (TypeError, ValueError): except (TypeError, ValueError):
warn('Cannot process event on channel %r: %s', warning('Cannot process event on channel %r: %s',
channel, repr(payload)[:4096], exc_info=1) channel, repr(payload)[:4096], exc_info=1)
raise Empty() raise Empty()
exchange = channel.split('/', 1)[0] exchange = channel.split('/', 1)[0]
self.connection._deliver( self.connection._deliver(