From 945f6b0f2c833f62c763eb5dc38497e9e843f9c7 Mon Sep 17 00:00:00 2001 From: Lucidiot Date: Mon, 26 May 2025 16:03:26 +0200 Subject: [PATCH] Replace deprecated SSL function for Python 3.12+ The `ssl.wrap_socket` function was deprecated in Python 3.7 and removed in Python 3.12, with `SSLContext.wrap_socket` being the new recommended function. It does the same thing, but with more options. --- pinhook/bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pinhook/bot.py b/pinhook/bot.py index 98abe4a..51aa080 100644 --- a/pinhook/bot.py +++ b/pinhook/bot.py @@ -43,7 +43,7 @@ def __init__(self, channels, nickname, server, **kwargs): self.disable_help = kwargs.get('disable_help', False) self.banned_users = kwargs.get('banned_users', []) if self.ssl_required: - factory = irc.connection.Factory(wrapper=ssl.wrap_socket) + factory = irc.connection.Factory(wrapper=ssl.SSLContext().wrap_socket) irc.bot.SingleServerIRCBot.__init__(self, [(server, self.port, self.server_pass)], nickname, nickname, connect_factory=factory) else: irc.bot.SingleServerIRCBot.__init__(self, [(server, self.port, self.server_pass)], nickname, nickname)