mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2026-08-24 02:24:23 -05:00
25 lines
634 B
Python
25 lines
634 B
Python
from __future__ import annotations
|
|
|
|
import sys
|
|
from importlib.metadata import PackageNotFoundError, version
|
|
|
|
__version__: str
|
|
|
|
try:
|
|
__version__ = version("chia-blockchain")
|
|
except (PackageNotFoundError, KeyError):
|
|
__version__ = "unknown"
|
|
|
|
if __version__ is None:
|
|
__version__ = "unknown"
|
|
|
|
try:
|
|
assert False
|
|
except AssertionError:
|
|
pass
|
|
else:
|
|
raise Exception("asserts are not working and _must_ be enabled, do not run with an optimized build of python")
|
|
|
|
if not getattr(sys, "_is_gil_enabled", lambda: True)():
|
|
raise Exception("freethreading is not supported, do not run with a freethreaded build of python")
|