* src/Mime/_PythonMime.py: Avoid crash on Windows if the mime type for a folder is to be determined

svn: r9844
This commit is contained in:
Martin Hawlisch 2008-01-16 13:16:58 +00:00
parent 4b68c57530
commit fdfa461cf1
2 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,8 @@
2008-01-16 Martin Hawlisch <martin@hawlisch.de>
* src/plugins/DateParserDisplayTest.py: Use Tool.ToolOptions instead of
None as options_class to make it no longer crash
* src/Mime/_PythonMime.py: Avoid crash on Windows if the mime type for
a folder is to be determined
2008-01-16 Benny Malengier <benny.malengier@gramps-project.org>
* src/Editors/_EditMediaRef.py:

View File

@ -55,7 +55,7 @@ def get_description(mime_type):
def get_type(filename):
"""Returns the mime type of the specified file"""
value = mimetypes.guess_type(filename)
if value:
if value and value[0]:
return value[0]
else:
return _('unknown')