diff --git a/labscript_utils/device_registry/_device_registry.py b/labscript_utils/device_registry/_device_registry.py index 256d76d..0c64cb2 100644 --- a/labscript_utils/device_registry/_device_registry.py +++ b/labscript_utils/device_registry/_device_registry.py @@ -1,12 +1,17 @@ import os import importlib -import imp import warnings import traceback import inspect from labscript_utils import dedent from labscript_utils.labconfig import LabConfig +# deal with removal of imp from python 3.12 +try: + import _imp as imp +except ImportError: + import imp + """This file contains the machinery for registering and looking up what BLACS tab and runviewer parser classes belong to a particular labscript device. "labscript device" here means a device that BLACS needs to communicate with. These devices have diff --git a/labscript_utils/modulewatcher.py b/labscript_utils/modulewatcher.py index 25df904..d9029dd 100644 --- a/labscript_utils/modulewatcher.py +++ b/labscript_utils/modulewatcher.py @@ -14,10 +14,15 @@ import threading import time import os -import imp import site import sysconfig +# deal with removal of imp from python 3.12 +try: + import _imp as imp +except ImportError: + import imp + # Directories in which the standard library and installed packages may be located. # Modules in these locations will be whitelisted: