Add IOError type of FileNotFoundError on Windows

This commit is contained in:
Peter Badida 2017-09-22 23:34:26 +02:00
parent e18cd352b3
commit f831055894
1 changed files with 5 additions and 1 deletions

View File

@ -46,7 +46,11 @@ def get_version(filename='kivy/version.py'):
GIT_REVISION = check_output(
['git', 'rev-parse', 'HEAD']
).strip().decode('ascii')
except (CalledProcessError, OSError):
except (CalledProcessError, OSError, IOError) as e:
# CalledProcessError has no errno
errno = getattr(e, 'errno', None)
if errno != 2 and 'CalledProcessError' not in repr(e):
raise
GIT_REVISION = "Unknown"
cnt = (