-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
`imp` module is removed in python3.12
- Loading branch information
Showing
1 changed file
with
3 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
[email protected] (Jiri Pirko) | ||
""" | ||
|
||
import importlib.machinery | ||
import signal | ||
import logging | ||
import os, stat | ||
|
@@ -19,7 +20,6 @@ | |
import socket | ||
import ctypes | ||
import multiprocessing | ||
import imp | ||
import types | ||
from time import sleep | ||
from inspect import isclass | ||
|
@@ -161,7 +161,8 @@ def load_cached_module(self, module_name, res_hash): | |
if module_name in self._dynamic_modules: | ||
return | ||
module_path = self._cache.get_path(res_hash) | ||
module = imp.load_source(module_name, module_path) | ||
module_loader = importlib.machinery.SourceFileLoader(module_name, module_path) | ||
module = module_loader.load_module() | ||
self._dynamic_modules[module_name] = module | ||
|
||
def init_cls(self, cls_name, module_name, args, kwargs): | ||
|