Fix the git version parser. · gitpython-developers/GitPython@6a61110 (original) (raw)

Original file line number Diff line number Diff line change
@@ -236,7 +236,7 @@ def _set_cache_(self, attr):
236 236 if attr == '_version_info':
237 237 # We only use the first 4 numbers, as everthing else could be strings in fact (on windows)
238 238 version_numbers = self._call_process('version').split(' ')[2]
239 -self._version_info = tuple(int(n) for n in version_numbers.split('.')[:4])
239 +self._version_info = tuple(int(n) for n in version_numbers.split('.')[:4] if n.isdigit())
240 240 else:
241 241 super(Git, self)._set_cache_(attr)
242 242 #END handle version info