Skip to content

Commit 851f354

Browse files
authored
Merge pull request #101 from ispielma/FixImpIssue
Fixes an issue where `imp` is no longer a python module
2 parents 77f5cf7 + da5a2c4 commit 851f354

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

labscript_utils/device_registry/_device_registry.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
import os
22
import importlib
3-
import imp
43
import warnings
54
import traceback
65
import inspect
76
from labscript_utils import dedent
87
from labscript_utils.labconfig import LabConfig
98

9+
# deal with removal of imp from python 3.12
10+
try:
11+
import _imp as imp
12+
except ImportError:
13+
import imp
14+
1015
"""This file contains the machinery for registering and looking up what BLACS tab and
1116
runviewer parser classes belong to a particular labscript device. "labscript device"
1217
here means a device that BLACS needs to communicate with. These devices have

labscript_utils/modulewatcher.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,15 @@
1414
import threading
1515
import time
1616
import os
17-
import imp
1817
import site
1918
import sysconfig
2019

20+
# deal with removal of imp from python 3.12
21+
try:
22+
import _imp as imp
23+
except ImportError:
24+
import imp
25+
2126

2227
# Directories in which the standard library and installed packages may be located.
2328
# Modules in these locations will be whitelisted:

0 commit comments

Comments
 (0)