From b02f5c89deda3488621c0bd30513bb72acf73752 Mon Sep 17 00:00:00 2001 From: Bastian Krause Date: Tue, 22 Aug 2023 16:59:37 +0200 Subject: [PATCH] common/reloader: import reload from importlib The imp module is deprecated since Python 3.4 [1]. The import was added even after it was deprecated in [2]. In Python 3.12 the imp module will be removed. Use the reload function from importlib, which is the designated replacement [1]. With #2091 and this change, crossbar can be installed and run on Python 3.12 with: - numpy>=1.26.0b1 - wsaccel @ git+https://github.com/methane/wsaccel@v0.6.4 (assuming cython>=3.0.0 is installed, tarball from pypi won't work [3]) [1] https://docs.python.org/3.11/library/imp.html [2] https://github.com/crossbario/crossbar/commit/21910b070c79016f7aa5ba62f897ba4f978f593f [3] https://github.com/methane/wsaccel/issues/30 --- crossbar/common/reloader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crossbar/common/reloader.py b/crossbar/common/reloader.py index 9c1927b76..c7eeedf61 100644 --- a/crossbar/common/reloader.py +++ b/crossbar/common/reloader.py @@ -14,7 +14,7 @@ reload except NameError: # Python 3 - from imp import reload + from importlib import reload __all__ = ('TrackingModuleReloader', )