import os
import sys
import traceback
+import subprocess
def _get_version():
try:
+ return subprocess.check_output(['git', 'describe', '--always', '--dirty'], cwd=os.path.dirname(os.path.abspath(__file__))).strip()
+ except:
+ pass
+ try:
root_dir = os.path.abspath(os.path.dirname(sys.argv[0]))
git_dir = os.path.join(root_dir, '.git')
if os.path.exists(git_dir):