Buildcache relocate.py error fix (#11616)

* Add a trailing / if file --mime does not return a mimetype with a / in it

* Flake8
This commit is contained in:
Patrick Gartung
2019-06-04 14:39:04 -05:00
committed by GitHub
parent a7776972ad
commit 964a1d5997
3 changed files with 5 additions and 5 deletions

View File

@@ -594,4 +594,6 @@ def mime_type(file):
file_cmd = Executable('file')
output = file_cmd('-b', '-h', '--mime-type', file, output=str, error=str)
tty.debug('[MIME_TYPE] {0} -> {1}'.format(file, output.strip()))
if '/' not in output:
output += '/'
return tuple(output.strip().split('/'))