Skip to content

Commit de7bb1b

Browse files
committed
quartuspgmdriver: update to importlib to be python3.21 compatible
1 parent 030f046 commit de7bb1b

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

labgrid/driver/quartuspgmdriver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import os
44
import re
55
import attr
6-
import imp
6+
import importlib
77
import tempfile
88
from pathlib import Path
99

@@ -63,7 +63,7 @@ def operate(self, filename=None, operation="P", devnum=1):
6363
log = logging.getLogger("QPGM_Driver")
6464

6565
try:
66-
lib_path = imp.find_module("libfilsel")[1]
66+
lib_path = importlib.machinery.PathFinder.find_spec('libfilsel').origin
6767
except Exception as e:
6868
return False, "could not find libfilsel!", str(e)
6969

labgrid/remote/exporter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from socket import gethostname, getfqdn
2020
import attr
2121
from autobahn.asyncio.wamp import ApplicationRunner, ApplicationSession
22-
import imp
22+
import importlib
2323

2424
from .config import ResourceConfig
2525
from .common import ResourceEntry, enable_tcp_nodelay, monkey_patch_max_msg_payload_size_ws_option
@@ -329,7 +329,7 @@ def acquire(self, *args, **kwargs):
329329
file.write(f"Password = \"{self.local.jtagd_password}\";")
330330

331331
#find the right path to the library
332-
lib_path = imp.find_module("libhwsf")[1]
332+
lib_path = importlib.machinery.PathFinder.find_spec('libfilsel').origin
333333

334334
#get the usb path from the device serial number
335335
serialNumber = self.local.device_serial

0 commit comments

Comments
 (0)