From 4b3122e29a2bcc068f3850d711b799ec118cf25d Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Tue, 27 Feb 2024 09:27:41 +0100 Subject: [PATCH] Remove imp module from tests to make them compatible with python 3.12 --- tests/modules/lib/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/modules/lib/__init__.py b/tests/modules/lib/__init__.py index f6df9204..9e3dfef7 100644 --- a/tests/modules/lib/__init__.py +++ b/tests/modules/lib/__init__.py @@ -1,7 +1,6 @@ # vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) -import imp import sys @@ -100,7 +99,7 @@ def replace_module(name, new=None, **kwargs): def new_module(name, **kwargs): - module = imp.new_module(name) + module = types.ModuleType(name) for k, v in kwargs.items(): setattr(module, k, v) return module