diff --git a/sardananxsrecorder/nxsrecorder.py b/sardananxsrecorder/nxsrecorder.py index 26a0cae..135164d 100644 --- a/sardananxsrecorder/nxsrecorder.py +++ b/sardananxsrecorder/nxsrecorder.py @@ -1020,8 +1020,10 @@ def __appendRecord(self, var, mode=None): self.__macro().warning( "NXS_FileRecorder: %s does not exist" % msf) else: - from importlib.machinery import SourceFileLoader - msm = SourceFileLoader('', msf).load_module() + import importlib.util + spec = importlib.util.spec_from_file_location('', msf) + msm = importlib.util.module_from_spec(spec) + spec.loader.exec_module(msm) ms = msm.main() if not isinstance(ms, dict): self.warning(