File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 2121# THE SOFTWARE.
2222
2323from enum import IntEnum
24- from importlib .metadata import version , packages_distributions
24+
25+ # python >= 3.10
26+ #from importlib.metadata import version, packages_distributions
27+ #distribution_name = packages_distributions()[__package__][0]
28+ # python < 3.10 (Focal, Bullseye)
29+ from importlib .metadata import version , distributions
30+ distribution_name = [dist .metadata ["Name" ] for dist in distributions () if __package__ in (dist .read_text ("top_level.txt" ) or "" ).split ()][0 ]
2531
2632"""
2733If SC-Controller is updated while daemon is running, DAEMON_VERSION send by
2834daemon will differ one one expected by UI and daemon will be forcefully restarted.
2935"""
30- DAEMON_VERSION = version (packages_distributions ()[ __package__ ][ 0 ] )
36+ DAEMON_VERSION = version (distribution_name )
3137
3238HPERIOD = 0.02
3339LPERIOD = 0.5
You can’t perform that action at this time.
0 commit comments