We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 066e873 commit 899fdc1Copy full SHA for 899fdc1
netbox_script_manager/util.py
@@ -5,6 +5,7 @@
5
import subprocess
6
import sys
7
import threading
8
+import importlib
9
10
from django.conf import settings
11
from utilities.querydict import normalize_querydict
@@ -73,7 +74,9 @@ def load_scripts():
73
74
75
try:
76
# Manually load the module
- module = importer.find_module(module_name).load_module(module_name)
77
+ spec = importer.find_spec(module_name)
78
+ module = importlib.util.module_from_spec(spec)
79
+ spec.loader.exec_module(module)
80
except Exception as e:
81
failed_modules[module_name] = e
82
logger.warning(f"Failed to load module {module_name}: {e}")
0 commit comments