From 0862810bca720d0d8fe4300569e2cce5ff6d37d4 Mon Sep 17 00:00:00 2001 From: kali Date: Mon, 7 Aug 2017 14:16:57 -0700 Subject: [bug] report version correctly in bundles - Resolves: #8992 --- src/leap/bitmask/__init__.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/leap/bitmask/__init__.py b/src/leap/bitmask/__init__.py index 6fd6174d..48490a05 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' -- cgit v1.2.3