Skip to content

Commit

Permalink
common/reloader: import reload from importlib (#2093)
Browse files Browse the repository at this point in the history
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/[email protected] (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] 21910b0
[3] methane/wsaccel#30
  • Loading branch information
Bastian-Krause authored Aug 24, 2023
1 parent 03d7057 commit 0089c1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crossbar/common/reloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
reload
except NameError:
# Python 3
from imp import reload
from importlib import reload

__all__ = ('TrackingModuleReloader', )

Expand Down

0 comments on commit 0089c1e

Please sign in to comment.