mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-01-19 01:18:19 +08:00
🚸 wrap version with try
This commit is contained in:
parent
74ce56817c
commit
f31318b7f4
@ -36,9 +36,14 @@ from nonebot.utils import escape_tag
|
||||
from nonebot.config import Env, Config
|
||||
from nonebot.log import logger, default_filter
|
||||
|
||||
_dist: pkg_resources.Distribution = pkg_resources.get_distribution("nonebot2")
|
||||
__version__ = _dist.version
|
||||
VERSION = _dist.parsed_version
|
||||
try:
|
||||
_dist: pkg_resources.Distribution = pkg_resources.get_distribution(
|
||||
"nonebot2")
|
||||
__version__ = _dist.version
|
||||
VERSION = _dist.parsed_version
|
||||
except pkg_resources.DistributionNotFound:
|
||||
__version__ = None
|
||||
VERSION = None
|
||||
|
||||
_driver: Optional[Driver] = None
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user