Skip to content

Commit

Permalink
change load_module to exec_module
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotan committed Apr 24, 2024
1 parent d86e683 commit 9bced95
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sardananxsrecorder/nxsrecorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 9bced95

Please sign in to comment.