File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -1052,8 +1052,22 @@ def get_versions():
1052
1052
except NotThisMethod:
1053
1053
pass
1054
1054
1055
+ root = os.path.realpath(__file__)
1056
+
1057
+ root_dir = os.path.dirname(root)
1058
+ if os.path.isfile(os.path.join(root_dir, 'VERSION')):
1059
+ with open(os.path.join(root_dir, 'VERSION')) as vfile:
1060
+ version = vfile.readline().strip()
1061
+
1062
+ return {
1063
+ "version": version,
1064
+ "full-revisionid": None,
1065
+ "dirty": None,
1066
+ "error": None,
1067
+ "date": None
1068
+ }
1069
+
1055
1070
try:
1056
- root = os.path.realpath(__file__)
1057
1071
# versionfile_source is the relative path from the top of the source
1058
1072
# tree (where the .git directory might live) to this file. Invert
1059
1073
# this to find the root from __file__.
You can’t perform that action at this time.
0 commit comments