diff --git a/zmq/log/handlers.py b/zmq/log/handlers.py index 841d80524..88fe571ca 100644 --- a/zmq/log/handlers.py +++ b/zmq/log/handlers.py @@ -218,7 +218,11 @@ def log(self, level, topic, msg, *args, **kwargs): # Generate the methods of TopicLogger, since they are just adding a # topic prefix to a message. for name in "debug warn warning error critical fatal".split(): - meth = getattr(logging.Logger, name) + try: + meth = getattr(logging.Logger, name) + except AttributeError: + # some methods are missing, e.g. Logger.warn was removed from Python 3.13 + continue setattr( TopicLogger, name,