Merge pull request #19 from markqvist/python_compat

Missing version resolution
This commit is contained in:
acehoss 2023-05-11 13:55:49 -05:00 committed by GitHub
commit 3dd98d7e9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,7 +31,11 @@ def _get_version():
import tomli
return tomli.load(open(os.path.join(os.path.dirname(module_dir), "pyproject.toml"), "rb"))["tool"]["poetry"]["version"]
except:
return "0.0.0"
try:
import pkg_resources
return pkg_resources.get_distribution("rnsh").version
except:
return "0.0.0"
except:
return "0.0.0"