Skip to content

Commit

Permalink
Removing deprecated module 'imp' in favour of 'importlib'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Williamson committed Nov 20, 2024
1 parent 4e7cd9a commit 6f146d9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions common/python/simulations.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import struct
import time
import bisect
import imp
import importlib
import os
import sys
from collections import namedtuple, deque
Expand Down Expand Up @@ -261,9 +261,9 @@ def create_block(self, ini_path, number, block_address):
ini_path = os.path.join(ROOT, ini_path)
module_path = os.path.dirname(ini_path)
try:
f, pathname, description = imp.find_module(
f, pathname, description = importlib.import_module(
block_name + "_sim", [module_path])
package = imp.load_module(
package = importlib.exec_module(
block_name + "_sim", f, pathname, description)
clsnames = [n for n in dir(package)
if n.lower() == block_name + "simulation"]
Expand Down

0 comments on commit 6f146d9

Please sign in to comment.