Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0192931

Browse files
committed
more thorough version information
1 parent e5347b3 commit 0192931

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

bipython/__init__.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,16 @@
4545

4646
Parenthesis = Token.Punctuation.Parenthesis
4747

48-
version = '%s (Python %s)' % (__version__, sys.version.split()[0])
48+
try:
49+
import subprocess
50+
commit = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD'], cwd=os.path.dirname(__file__)).strip()
51+
__version__ += ' [' + commit + ']'
52+
except:
53+
pass
54+
55+
version = '%s (Python %s) ' % (__version__, sys.version.split()[0])
56+
57+
4958

5059
# Urwid colors are:
5160
# 'black', 'dark red', 'dark green', 'brown', 'dark blue',

0 commit comments

Comments
 (0)