Remove imp module from tests to make them compatible with python 3.12 (#2251)

This commit is contained in:
Robin Candau 2024-02-27 09:59:10 +00:00 committed by GitHub
parent 14cc0d2df8
commit c04a8dd5a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 2 deletions

View File

@ -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