summaryrefslogtreecommitdiff
path: root/src/leap
diff options
context:
space:
mode:
authorkali <kali@leap.se>2017-08-07 14:16:57 -0700
committerKali Kaneko <kali@leap.se>2017-08-14 18:10:14 -0400
commit0862810bca720d0d8fe4300569e2cce5ff6d37d4 (patch)
tree7cecb101cc204d1b7ec1f56692fd31949b8785e1 /src/leap
parent523ec97cafcaff3090edbe18a1edcb4e615370a0 (diff)
[bug] report version correctly in bundles
- Resolves: #8992
Diffstat (limited to 'src/leap')
-rw-r--r--src/leap/bitmask/__init__.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/leap/bitmask/__init__.py b/src/leap/bitmask/__init__.py
index 6fd6174..48490a0 100644
--- a/src/leap/bitmask/__init__.py
+++ b/src/leap/bitmask/__init__.py
@@ -1,5 +1,7 @@
+import os
import sys
import pkg_resources
+from .util import here
from ._version import get_versions
if not getattr(sys, 'frozen', False):
@@ -10,5 +12,12 @@ if not getattr(sys, 'frozen', False):
# 'pip install -e .' and 'pip install leap.common'
pkg_resources.get_distribution('leap.bitmask')
-__version__ = get_versions()['version']
-del get_versions
+ __version__ = get_versions()['version']
+ del get_versions
+
+else:
+ try:
+ __version__ = open(os.path.join(
+ here(), 'version')).read().strip()
+ except Exception:
+ __version__ = '0+0xacab-unknown'