From c10f71a867ae434e3d9bc671293131a9b0b97a71 Mon Sep 17 00:00:00 2001 From: Dunedan Date: Sat, 21 Sep 2024 12:10:04 +0200 Subject: [PATCH] Make the plugin work with Python 3.12 --- __init__.py | 2 +- test.py | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/__init__.py b/__init__.py index 05503a5..12319cc 100755 --- a/__init__.py +++ b/__init__.py @@ -51,7 +51,7 @@ from . import config from . import plugin -from imp import reload +from importlib import reload reload(config) # In case we're being reloaded. reload(plugin) diff --git a/test.py b/test.py index 8ea4229..4abd09d 100755 --- a/test.py +++ b/test.py @@ -51,7 +51,7 @@ def testTicketUrl(self): msg = self.irc.takeMsg() count += 1 - self.assertEquals(count, 0) + self.assertEqual(count, 0) obj.doPrivmsg( self.irc, @@ -60,13 +60,13 @@ def testTicketUrl(self): count = 0 msg = self.irc.takeMsg() while msg is not None: - self.assertEquals(msg.nick, "") - self.assertEquals(msg.args[0], self.config["supybot.plugins.wfg.channels"][0]) - self.assertEquals(msg.args[1], "#666 - Remove Devil – https://gitea.wildfiregames.com/0ad/0ad/issues/666") + self.assertEqual(msg.nick, "") + self.assertEqual(msg.args[0], self.config["supybot.plugins.wfg.channels"][0]) + self.assertEqual(msg.args[1], "#666 - Remove Devil – https://gitea.wildfiregames.com/0ad/0ad/issues/666") msg = self.irc.takeMsg() count += 1 - self.assertEquals(count, 1) + self.assertEqual(count, 1) def testPullRequestUrl(self): obj = self.irc.getCallback('wfg') @@ -80,7 +80,7 @@ def testPullRequestUrl(self): msg = self.irc.takeMsg() count += 1 - self.assertEquals(count, 0) + self.assertEqual(count, 0) obj.doPrivmsg( self.irc, @@ -89,11 +89,11 @@ def testPullRequestUrl(self): count = 0 msg = self.irc.takeMsg() while msg is not None: - self.assertEquals(msg.nick, "") - self.assertEquals(msg.args[0], self.config["supybot.plugins.wfg.channels"][0]) - self.assertEquals(msg.args[1], "#7028 - Add yamllint to pre-commit – https://gitea.wildfiregames.com/0ad/0ad/pulls/7028") + self.assertEqual(msg.nick, "") + self.assertEqual(msg.args[0], self.config["supybot.plugins.wfg.channels"][0]) + self.assertEqual(msg.args[1], "#7028 - Add yamllint to pre-commit – https://gitea.wildfiregames.com/0ad/0ad/pulls/7028") msg = self.irc.takeMsg() count += 1 - self.assertEquals(count, 1) + self.assertEqual(count, 1) # vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: