1
0
mirror of synced 2024-11-22 09:14:23 +01:00

Fix the build

This commit is contained in:
jvoisin 2018-05-16 00:08:45 +02:00
parent be6d32afa8
commit 7afff93e9c

View File

@ -30,11 +30,12 @@ def get_parser(filename: str) -> (T, str):
# A set of extension that aren't supported, despite matching a known mimetype # A set of extension that aren't supported, despite matching a known mimetype
unknown_extensions = set(['bat', 'c', 'h', 'ksh', 'pl', 'txt', 'asc', unknown_extensions = set(['bat', 'c', 'h', 'ksh', 'pl', 'txt', 'asc',
'text', 'pot', 'brf', 'srt', 'rdf', 'wsdl', 'xpdl', 'xsl', 'xsd']) 'text', 'pot', 'brf', 'srt', 'rdf', 'wsdl', 'xpdl', 'xsl', 'xsd'])
mtype, _ = mimetypes.guess_type(filename)
_, extension = os.path.splitext(filename) _, extension = os.path.splitext(filename)
if extension in unknown_extensions: if extension in unknown_extensions:
return None, mtype return None, mtype
mtype, _ = mimetypes.guess_type(filename)
for c in _get_parsers(): for c in _get_parsers():
if mtype in c.mimetypes: if mtype in c.mimetypes:
try: try: